سؤال

I have recently switched to Django for a web app I'm developing and I followed the instructions at Heroku for getting a Django app running on Heroku. I have a virtual environment in which my app is developed and I use git for version control and to push to Heroku. The link above suggests that I intall gunicorn:

The examples above used the default HTTP server for Django. For production apps, you may wish to use a more production-ready embedded webserver, such as Tornado, gevent’s WSGI server, or Gunicorn.

They then walk the user through installing Gunicorn.

My question is: what problems might I run into if I skip this step and just stay with the default? What benefits will Gunicorn give me?

هل كانت مفيدة؟

المحلول

Gunicorn is production ready and really easy to use. I use it for my websites. You usually should run it via a reverse proxy like Nginx. I'm not sure what Heroku is using. You really should try it.

In my experience it's much easier to use and configure than apache & mod_wsgi, and the other similar setups.

edit/update: As a summary of the comments below, Heroku already uses Nginx as a reverse proxy

نصائح أخرى

Much better performance, and probably better security and stability, too. Django's development web server (which is used by Heroku by default) isn't really designed to serve production applications.

django's server, is a development server . It is light weigh and easy to use but should not be used in production because it is not production ready. it cannot handle many requests. This link offers a comparison between gunicorn, uwsgi and django's development server.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top