Comment by Codayus

15 years ago

Point 7 - Port Binding: I'm interested in hearing anyone else's views on this. How would you even do this for a Django app? And is this really better than just using WSGI? Is anyone using Tornado with Django in production? Google showed a couple proof of concept demos, but nothing serious.

At the moment, I have some apps deployed with nginx > uwsgi > django, taking advantage of the fact that nginx has built in support for uwsgi these days. This breaks rule 7, since my app isn't just binding to a port - but would I really be better off by using nginx > tornado > django?

Django works well under gunicorn HTTP server: http://gunicorn.org/

  • Let me rephrase - Django is typically run as a WSGI app. uWSGI is a WSGI server that can speak HTTP or its own uwsgi protocol (currently supported by nginx and cherokee). Gunicorn is a WSGI server that can speak HTTP. So my options are:

    1) nginx -> via uwsgi -> uWSGI -> via WSGI -> django 2) nginx -> via http -> uWSGI -> via WSGI -> django 3) nginx -> via http -> gunicorn -> via WSGI -> django

    This article seems to say that my app really needs to talk to nginx via http, so option 2 or 3 is okay, but option 1 is bad. Why is this?

    My feeling is that for the purposes of being a 12 factor app, uwsgi protocol is fine, despite how they've phrased it...