Search code examples
pythonmysqljsondjangodropbox

django-storages dropbox.stone_validators.ValidationError


I am trying to use dropbox as media sotrage. I am trying to implement through django-storages.

settings.py

DEFAULT_FILE_STORAGE = 'storages.backends.dropbox.DropBoxStorage'
DROPBOX_OAUTH2_TOKEN = 'token'
DROPBOX_ROOT_PATH = '/media/'

models.py

logo = models.ImageField(upload_to=r'logo/%Y/%m/')
image = models.ImageField(upload_to=r'photos/%Y/%m/',
 help_text='Image size: Width=1080 pixel. Height=1920 pixel',)

error

Request Method: | POST

Request URL: | http://127.0.0.1:8000/add

Django Version: | 2.1.8

Exception Type: | ValidationError

Exception Value: | 'D:/media/10506738_10150004552801856_220367501106153455_o.jpg' did not match pattern '(/(.|[\r\n])|id:.)|(rev:[0-9a-f]{9,})|(ns:[0-9]+(/.*)?)'

console

dropbox.stone_validators.ValidationError: 'D:/media/10506738_10150004552801856_220367501106153455_o.jpg' did not match pattern '(/(.|[\r\n])|id:.)|(rev:[0-9a-f]{9,})|(ns:[0-9]+(/.*)?)'

I can't figure out why this error is happening?


Solution

  • The issue is with the Windows operating system Path. I tried with the same settings in Ubuntu. It's working there flawlessly.