Reputation: 976
In my projects settings.py I have set
ADMIN_MEDIA_PREFIX='/static/admin/'
The admin media is being served in the correct location, browsing to http://127.0.0.1:8000/static/admin/css/base.css gives me the base.css for the admin page. But when I inspect the admin pages they are still attempting to find the admin media at '/media/admin/'. I'm not sure what is wrong here. This is what I get when I attempt to find the setting in a manage.py shell.
>>> from django.conf import settings
>>> settings.ADMIN_MEDIA_PREFIX
'/media/admin/'
This should be '/static/admin/'.
Upvotes: 0
Views: 1499
Reputation: 976
James was right. I had a second settings.py defined for my development environment that was overriding my main settings. I've deleted ADMIN_MEDIA_PREFIX from that file and now everything works as expected. Thank you!!
Upvotes: 2
Reputation: 482
I sometimes get a similar problem where I've clearly made changes but the code still behaves a la pre-change. Sometimes making sure I've saved with fix it, but other times the compiled python files (.pyc) don't seem to update. Deleting the .pyc file sometimes fixes my issue. Note that when you ./manage.py runserver
again, the .pyc will be generated with the updated code.
Maybe try deleting your settings.pyc?
Upvotes: 0