I'm using the following API:
I have everything exactly configured, from the installed lib to the settings of settings.py.
The lib 'storages' in INSTALLED_APPS and the three dropbox connection variables:
DEFAULT_FILE_STORAGE = 'storages.backends.dropbox.DropBoxStorage'
DROPBOX_OAUTH2_TOKEN = 'meu_token'
DROPBOX_ROOT_PATH = '/media/'
I want the FileField and ImageField fields to upload an image or file and save it in the / media / folder of the project and dropbox, keeping the image in production, having the App created and configured to be app_folder. / p>
If I remove the three dropbox configuration variables and try to modify or add an image by django admin it is possible, however, when I return the variables and try again, the following error appears:
ValidationError at /admin/catalog/product/6/change/
'C:/media/products/cortina-city.jpg' did not match pattern '(/(.|[\r\n])*|id:.*)|(rev:[0-9a-f]{9,})|(ns:[0-9]+(/.*)?)'
It also gives error in dropbox.py of lib:
C:\Users\evert\Desktop\Synth\SynthDev\myenv\lib\site-packages\storages\backends\dropbox.py in exists
return bool(self.client.files_get_metadata(self._full_path(name))) ...
C:\Users\evert\Desktop\Synth\SynthDev\myenv\lib\site-packages\dropbox\base.py in files_get_metadata
include_property_groups) ...
C:\Users\evert\Desktop\Synth\SynthDev\myenv\lib\site-packages\dropbox\files.py in __init__
self.path = path ...
C:\Users\evert\Desktop\Synth\SynthDev\myenv\lib\site-packages\dropbox\files.py in path
val = self._path_validator.validate(val) ...
C:\Users\evert\Desktop\Synth\SynthDev\myenv\lib\site-packages\dropbox\stone_validators.py in validate
% (val, self.pattern))
I understand that you are not identifying the url get pattern. I imagine that C: should not go together in the string and is going, ie 'C: / media / products / ..'.
How to solve this?