views:

275

answers:

3

I'd like to know how I can maintain sessions while developing on my local machine (django, apache, mod-wsgi).

Each time I make updates to python code I need to restart Apache for the changes to take effect.

A: 

You only need to touch your WSGI script for the changes to take effect.

Imran
A: 

Put this in your Apache conf file.

MaxRequestsPerChild 1

This will force Apache to reload the python files after each request.

Lenni
I have this - it won't reload python files or keep the sessions.
Eeyore
+2  A: 

Read the documentation. See:

http://code.google.com/p/modwsgi/wiki/ReloadingSourceCode

It explains in a great amount of detail about source code reloading in Apache/mod_wsgi.

Just touching the WSGI script file will not do anything if you aren't use mod_wsgi in the correct mode.

And yes you can use Apache/mod_wsgi as a development server if you set it up with daemon mode and code change monitor as documented in that page.

As for MaxRequestsPerChild, that is not recommended and will only work in embedded mode of mod_wsgi and not in daemon mode.

Graham Dumpleton