Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Even if I followed the official instructions, when I start a Django test site using uWSGI, CSS files for the admin interface are not loaded. If I open the URL of a CSS file, for example http://localhost:8443/static/admin/css/base.css, I get a 404 error. I searched for the local file and I guess its path is /usr/local/lib/python3.3/dist-packages/django/contrib/admin/static/admin/css/base.css; so I also tried to run uwsgi as root, but nothing changed.

I have no problem using python3 runserver. If I open http://localhost:8000/static/admin/css/base.css, the file is loaded in the browser, and the style is applied to the admin page.

This is the command I execute in bash:

uwsgi --ini ~/.uwsgi/conf/django.ini --set-placeholder project_name=mysite --set-placeholder port=8443

and this is the content of django.ini:

module = %(project_name).wsgi:application
https = :%(port),/usr/local/nginx/conf/server.crt,/usr/local/nginx/conf/server.key,HIGH
strict = true
chdir = /home/marco/django-projects/%(project_name)
env = DJANGO_SETTINGS_MODULE=%(project_name).settings
socket = /home/marco/.uwsgi/%(project_name).socket
pidfile = /home/marco/.uwsgi/%(project_name).pid
daemonize = /home/marco/.uwsgi/%(project_name).log
master = true
enable-threads = true
harakiri = 20
max-requests = 5000
vacuum = true
share|improve this question
up vote 1 down vote accepted

Official deployment docs (independently by the WSGI server) do not cover serving static files (that is generally managed by the webserver). The right docs are here:

eventually serving static files is pretty easy with uWSGI:

but if you can do it in nginx it is better

share|improve this answer
Thank you, I also followed this simple tutorial: , even if it does not remember to add to PROJECT/ the line STATIC_ROOT = os.path.join(BASE_DIR, "static")and run python3 collectstatic. – Marco Sulla Dec 14 '13 at 22:07

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.