I know that there are already a lot of information on this topic, but they are quite clumsy, not so simple and expressive.
Could anyone explain me how to use django
and with mod_wsgi
and apache
?
mod_wsgi isn't particularly the best fit for running Python WSGI applications, or, if you'd rather, there are more pythonic ways you can run your Django instance.
First off, I'd reason that it takes a lot of effort to understand Apache's request processing model and to configure it correctly, especially with respect to mod_wsgi. If your not exactly set or locked into using Apache, I would recommend that you take a look at running Spawning or Green Unicorn, behind a nginx proxy like @Neo suggested.
Spawning and gunicorn are both ridiculously fast, don't require that you compile Apache with a specific Python interpreter and provide support for progressively updating your code base on the fly, hooks for Django and other goodies out of the box. nginx, Spawning and gunicorn all have a simple processing model, are kept completely independent of each other, so you get a more transparent architecture that is easier to maintain and monitor.
Here's a great guide on setting up Spawning with Django by Eric Florenzano, and here's a thorough presentation on running Django with gunicorn by the project's author, Benoît Chesneau.
Whichever you choose, you'll be feeling right @home.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With