--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/d3041741-1604-473f-8810-263bb3b16c59n%40googlegroups.com.
Apache and nginx are called "web servers". Windows and FreeBSD are called "operating systems". What is the term for Gunicorn, uWSGI and mod_wsgi? I believe there's no good term, which is one reason for the confusion.
Gunicorn, uWSGI and mod_wsgi are specialized web servers that run Python WSGI-compliant applications. For lack of a better name, I'll call them Python application servers, but don't forget that they are nothing more (and nothing less) than specialized web servers that run Python WSGI-compliant applications.
What the Python application server does is
from djpro.wsgi import application
and then, in each HTTP request, it calls application() in a standard way that is specified by the WSGI specification. The fact that the interface of this function is standardized is what permits you to choose between many different Python application servers such as Gunicorn, uWSGI, or mod_wsgi, and why each of these can interact with many Python application frameworks like Django or Flask.
The Python application server does not communicate with the Django project, it imports the Django project. From the point of view of the operating system, it is the same process. You don't have a separate server which "runs" or "communicates with" Django, which would mean that the Python application server and Django could run in separate virtualenvs. You have a single Python program and there is only one virtualenv. What we do for Gunicorn, for example, is install it in the same virtualenv where we have Django (pip install gunicorn), and then run it from there.
I am not familiar with mod_wsgi, but the thing is, by the time it's ready to import the Django project, Python is already running, and you can't select or change a virtualenv any more. So selecting a virtualenv (which I assume is possible) must be in the mod_wsgi configuration. I hope these principles help you understand mod_wsgi's documentation.
I find Gunicorn an easier and better way to deploy, regardless the web server. More information:
Antonis Christofides +30-6979924665 (mobile)