Why is gunicorn_django not recommended anymore?

穿精又带淫゛_ 提交于 2019-12-21 07:38:46

问题


We have an app deployed using gunicorn_django in production. I've noticed that it's no longer recommended. I'm wondering why it's not recommended, and whether we need to migrate to the newer way.

From https://docs.djangoproject.com/en/dev/howto/deployment/wsgi/gunicorn/

If you run Django 1.4 or newer, it’s highly recommended to simply run your application with the WSGI interface using the gunicorn command.


回答1:


The essential part of gunicorn_django, wsgi.py, became integrated in Django itself.

To quote an already existing answer:

Starting with Django 1.4, your project will already have a wsgi.py, which can be used with any wsgi server (of which there are many, gunicorn being just one).

Essentially the old Django integration for gunicorn was just a convenience to get you up and running faster, but it's no longer necessary because all Django projects now have wsgi.py.

UPDATE

First of all, in Gunicorn 18.0 gunicorn_django became deprecated.

Second, since the first writing of this answer I have personally encountered obscure errors that were specific to gunicorn_django in conjunction with --settings command line parameter (gunicorn command and ./manage.py runserver worked fine).

Namely, the obscure import error application.some_model: 'field' has a relation with model another_application.AnotherModel, which has either not been installed or is abstract.

So, no, I would not recommend you using gunicorn_django in your new projects.



来源:https://stackoverflow.com/questions/16369354/why-is-gunicorn-django-not-recommended-anymore

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!