0

The media directory is working as expected in my local machine but when I push the code to Heruko or Cloud Foundry the media is not working.

How to rectify this issue?

urls.py

urlpatterns = [

            url(r'^profile/$', view_profile, name='view_profile'),

          ]+ static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)

settings.py

MEDIA_DIR = os.path.join(BASE_DIR, "media")
# Medta files location
MEDIA_ROOT = MEDIA_DIR
MEDIA_URL = '/media/'
Mohamed Naveen
  • 131
  • 1
  • 4
  • 8

0 Answers0