How to set mod_wsgi for apache and django?

后端 未结 3 1293
清酒与你
清酒与你 2021-01-31 23:54

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

3条回答
  •  暖寄归人
    2021-02-01 00:21

    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.

提交回复
热议问题