I am logged in while configuring the Django self-contained management interface Http://domain.com/admin There is a problem with the style sheet missing in the background, the interface becomes this:
650) this.width=650; "src=" Http://wangye.org/blog/wp-content/uploads/2012/03/20120309165313.png "alt=" Django Admin management interface style missing "/>
System Environment: centos6.5+nginx1.5.9+uwsgi2.0.4+django1.4.9
Nginx configuration file:
server { listen 80; server_name www.omserver.com; location / { uwsgi_pass 192.168.202.128:9000; include uwsgi_params; uwsgi_param UWSGI_CHDIR /data/www/OMserverweb; uwsgi_param UWSGI_SCRIPT django_wsgi; access_log off; } location ^~ /static { root /data/www/omserverweb; } location ~* ^.+\. (mpg|avi|mp3|swf|zip|tgz|gz|rar|bz2|doc|xls|exe|ppt|txt|tar|mid|midi|wav|rtf|mpeg) $ { root /data/www/OMserverweb/static; access_log off; } }
Uwsgi configuration file:
[Uwsgi]socket = 0.0.0.0:9000master = Truepidfile =/usr/local/nginx/uwsgi.pidprocesses = 8chdir =/data/www/ Omserverwebpythonpath =/data/wwwprofiler = truememory-report=trueenable-threads=truelogdate=truelimit-as= 6048daemonize=/data/logs/django.log
1. Modificationssettings.pyInStatic_rootThe physical path for your static files, for example, my static files are stored in/data/www/omserverweb/static, first create the static folder under the WWW directory, and finally modify thesettings.pyInStatic_rootPointing/data/www/omserverweb/static。
2. Run the python manage.py collectstatic Command, which copies the required static files from the Django resource bundle to the static folder Static_root indicated. This includes the style sheets (styles), images, and scripts (JS) that are necessary for the admin interface.
or copy the file directly to the static directory:
Cp-r/usr/lib/python2.6/site-packages/django/contrib/admin/static/*/data/www/omserverweb/static/
Resources:
http://wangye.org/blog/archives/572/
Resolving the Django Admin Interface style sheet (CSS style) loss problem