I am trying to use dropbox as a backend storage solution for django using django-storages, i followed the documentation but i am getting this error:
'C:/media/post_pics/profile_pic.jpeg' did not match pattern '(/(.|[\r\n])*|id:.*)|(rev:[0-9a-f]{9,})|(ns:[0-9]+(/.*)?)'
This is my models.py
:
class Post(models.Model):
title = models.CharField(max_length=64)
date = models.DateField(timezone.now())
picture = models.ImageField(upload_to='post_pics')
...and my settings.py
:
STATIC_URL = '/static/'
MEDIA_URL = '/media/'
MEDIA_ROOT = os.path.join(BASE_DIR, 'media')
# Dropbox media file storage
DEFAULT_FILE_STORAGE = 'storages.backends.dropbox.DropBoxStorage'
DROPBOX_OAUTH2_TOKEN = 'myToken'
DROPBOX_ROOT_PATH = '/media/'
It turns out it was just a problem with how windows path works, using a linux system solved it