I was deployng my project to Heroku and set up the DEBUG
option to False
. Until that, all was working ok. But, now, I can't server the user profile images. I want to server only with the Django, not with Apache or Nginx. I know that it's not the best option, but I don't need the best way to do this, so, if exists any way to server this with only the Django, will better to me.
This is my settings.py
:
MEDIA_URL = '/media/'
MEDIA_ROOT = os.path.join(BASE_DIR, 'saga', 'media')
STATIC_ROOT = os.path.join(BASE_DIR, 'staticfiles')
STATIC_URL = '/static/'
STATICFILES_STORAGE = 'whitenoise.storage.CompressedManifestStaticFilesStorage'
This is my urls.py
:
from django.conf import settings
urlpatterns = [
#URLs
] + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT) + static(settings.STATIC_URL, document_root=settings.STATIC_ROOT)
And I think that's goodn say that I'm using the WhiteNoise to server the Static Files on Heroku.