Eeyore
Eeyore

Reputation: 2126

Apache Django Mod_Wsgi Sessions Development Environment

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.

Upvotes: 0

Views: 663

Answers (3)

Graham Dumpleton
Graham Dumpleton

Reputation: 58523

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.

Upvotes: 2

Leonard Ehrenfried
Leonard Ehrenfried

Reputation: 1613

Put this in your Apache conf file.

MaxRequestsPerChild 1

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

Upvotes: 0

Imran
Imran

Reputation: 90999

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

Upvotes: 0

Related Questions