Live data from Hacker News

How to configure nginx and uWSGI to serve Django projects

blog.eyallupu.com

1–10 of 24 posts

Re: How to configure nginx and uWSGI to serve Django projects

#2
We found that Debian-packaged uWSGI is missing one param in uwsgi_params so you should use this instead:

    location / {
        uwsgi_pass ;
        include uwsgi_params;
        uwsgi_param UWSGI_SCHEME $scheme;
    }
Without the UWSGI_SCHEME part, Django's Request.get_absolute_uri will return URIs starting with 'http' even if your site is served over HTTPS.

Re: How to configure nginx and uWSGI to serve Django projects

#6
A good addition would be to use supervisord for running the uwsgi process at system startup. (as described here: http://brandonkonkle.com/blog/2010/sep/14/django-uwsgi-and-n...)

For a good comparison on different WSGI servers (aka uwsgi vs gunicorn, etc):

http://nichol.as/benchmark-of-python-web-servers

Re: How to configure nginx and uWSGI to serve Django projects

#7

A good addition would be to use supervisord for running the uwsgi process at system startup. (as described here: http://brandonkonkle.com/blog/2010/sep/14/django-uwsgi-and-n... ) For a good comparison on different WSGI servers (aka uwsgi vs gunicorn, etc): http://nichol.as/benchmark-of-python-web-servers

supervisor is great, but if you want to host multiple applications the best way would be the uWSGI Emperor http://projects.unbit.it/uwsgi/wiki/Emperor

Regarding the benchmark, it is a bit outdated and the apache+mod_wsgi analysys/configuration is totally wrong (i am one of the uWSGI authors, but mod_wsgi is great, and seeing it blasted wrongly in that url is a bit disappointing)

By the way, do not choose your application server looking only at performance.really.

Re: How to configure nginx and uWSGI to serve Django projects

#8
How many more of these tutorials do we actually need? It doesn't actually go into any real detail on what is happening for someone new to trying to bring up a dev box, and it certainly doesn't help those of us more experienced.

What about setting up logging, email, exception emails, time zone, https - things that are actually important for those that haven't done installations much.

Re: How to configure nginx and uWSGI to serve Django projects

#10
post #7

A good addition would be to use supervisord for running the uwsgi process at system startup. (as described here: http://brandonkonkle.com/blog/2010/sep/14/django-uwsgi-and-n... ) For a good comparison on different WSGI servers (aka uwsgi vs gunicorn, etc): http://nichol.as/benchmark-of-python-web-servers

supervisor is great, but if you want to host multiple applications the best way would be the uWSGI Emperor http://projects.unbit.it/uwsgi/wiki/Emperor Regarding the benchmark, it is a bit outdated and the apache+mod_wsgi analysys/configuration is totally wrong (i am one of the uWSGI authors, but mod_wsgi is great, and seeing it blasted wrongly in that url is a bit disappointing) By the way, do not choose your applica…

I've followed uWSGI development on and off for a little while, but I never knew about Emperor. I've been looking for something similar for a while. Thanks a lot for your work!
Post reply on HN