﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
19208	Daemon mode and mod_wsgi configuration.	Graham Dumpleton	Aymeric Augustin	"The mod_wsgi documentation at:

https://docs.djangoproject.com/en/1.4/howto/deployment/wsgi/modwsgi/

says:

""""""
""Daemon mode"" is the recommended mode for running mod_wsgi (on non-Windows platforms). See the official mod_wsgi documentation for details on setting up daemon mode. The only change required to the above configuration if you use daemon mode is that you can't use WSGIPythonPath; instead you should use the python-path option to WSGIDaemonProcess, for example:

WSGIDaemonProcess example.com python-path=/path/to/mysite.com:/path/to/venv/lib/python2.7/site-packages
""""""

This information fails to mention that you also need to set WSGIProcessGroup to delegate the Django instance to run in the daemon process group. Worse is that it says 'The only change required to the above configuration if you use daemon mode'. Thus those who never actually read documentation properly and will just cut and paste will have issues.

Results is that keep seeing examples of people who have not done this and who have either done one of the following:

1. Set WSGIPythonPath and python-path and then are oblivious to the fact that they aren't running in daemon mode and are still running in embedded mode.
2. Don't set WSGIPythonPath and then get that Django settings module can't be found on startup because it doesn't know where to find it.

I noted this common problem of WSGIProcessGroup not being set in:

http://blog.dscpl.com.au/2012/10/why-are-you-using-embedded-mode-of.html

I didn't realise until now that Django documentation on mod_wsgi was contributing to that.

Suggest that:

""""""
""Daemon mode"" is the recommended mode for running mod_wsgi (on non-Windows platforms). See the official mod_wsgi documentation for details on setting up daemon mode. The only change required to the above configuration if you use daemon mode is that you can't use WSGIPythonPath; instead you should use the python-path option to WSGIDaemonProcess, for example:

WSGIDaemonProcess example.com python-path=/path/to/mysite.com:/path/to/venv/lib/python2.7/site-packages
""""""

be changed to something like:

""""""
""Daemon mode"" is the recommended mode for running mod_wsgi (on non-Windows platforms). To create the required daemon process group and delegate the Django instance to run in it you will need to add appropriate WSGIDaemonProcess and WSGIProcessGroup directives. A further change required to the above configuration if you use daemon mode is that you can't use WSGIPythonPath; instead you should use the python-path option to WSGIDaemonProcess, for example:

WSGIDaemonProcess example.com python-path=/path/to/mysite.com:/path/to/venv/lib/python2.7/site-packages
WSGIProcessGroup example.com

See the official mod_wsgi documentation for details on setting up daemon mode. 
""""""

The link into the mod_wsgi documentation is probably best set to:

http://code.google.com/p/modwsgi/wiki/QuickConfigurationGuide#Delegation_To_Daemon_Process"	Bug	closed	Documentation	1.4	Normal	fixed			Accepted	0	0	0	0	0	0
