I'm trying to deploy this application with nginx/gunicorn but I don't know why the admin media files are missing.
settings.py:
ADMIN_MEDIA_PREFIX = '/srv/www/antingprojects.com.ar/gobras/static/admin/'
I also tried:
ADMIN_MEDIA_PREFIX = '/static/admin/'
project folder:
/srv/www/antingprojects.com.ar/gobras/static/admin/css|js|img
urls.py:
(r'^static/admin/(?P<path>.*)$', 'django.views.static.serve')
nginx access.log:
"GET /admin/ HTTP/1.1" 200 1556 "-"
"GET /srv/www/antingprojects.com.ar/gobras/static/admin/css/base.css HTTP/1.1" 404 1136 "http://antingprojects.com.ar/admin/"
"GET /srv/www/antingprojects.com.ar/gobras/static/admin/css/dashboard.css HTTP/1.1" 404 1141 "http://antingprojects.com.ar/admin/"
"GET /admin_media/img/admin/nav-bg.gif HTTP/1.1" 404 1114
You need to set up a symbolic link from the directory where the admin media files are to the static media directory you are using to serve your static files.
The admin media files should be at something like:
path/to/django/contrib/admin/media/
Once your symlink is set up you would set your ADMIN_MEDIA_PREFIX to the symbolic directory within the directory where you serve your static files, so something like this should work:
ADMIN_MEDIA_PREFIX = '/static/admin/'
Check to see where your admin is trying to load its media files from, and this should help you get started if you can't figure out which directory to use.
Here's a quick tutorial on symlinks:
http://ubuntuforums.org/showthread.php?t=255573
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With