Meir
Meir

Reputation: 1711

Working with django and mod_wsgi in Windows

I finished installing django on my Windows machine using Apache 2.2/Python 2.6/Django 1.3/mod_wsgi. It seems like everytime I change my Python code (such as settings.py), I need to restart Apache in order for changes to take effect.

I understood that using WSGIRestrictEmbedded should solve this issue but the docs for wsgi state about WSGIRestrictEmbedded that:

This option does not exist on Windows, or Apache 1.3 or any other configuration where daemon mode is not available.

What can I do then in order to avoid restarting Apache on every change?

Upvotes: 0

Views: 613

Answers (2)

Graham Dumpleton
Graham Dumpleton

Reputation: 58523

Read:

http://blog.dscpl.com.au/2009/02/source-code-reloading-with-modwsgi-on.html

It refers you to how to enable auto reload on Windows when using Apache/mod_wsgi.

Use of mod_wsgi is important when you need to test the multithread safety of your application and inbuilt development server is not multithreaded.

This auto reload mode should not be used on production systems.

Upvotes: 2

Daniel Roseman
Daniel Roseman

Reputation: 599470

The answer is: don't use Apache in development. Use the built-in development server, or perhaps gunicorn.

Upvotes: 1

Related Questions