[Django]-Serving static files for development mode in Django

1👍

It doesn’t work, because what I was trying to do wasn’t very wise.

That’s how it should be configured. settings.py:

MEDIA_URL = '/media/'
STATIC_URL = '/static/'

MEDIA_ROOT = 'media.mydomain.com'
STATIC_ROOT = 'static.mydomain.com'

STATIC_DIRS = (
    os.path.join(os.path.abspath(os.path.dirname(__file__) + '/..'), 'static'),
)

All the files remain in place, exactly where they were.

👤julx

0👍

I had a similar problem, adding an explicit reference to the media location in my urlconf as per this fixed the problem for me.

Leave a comment