Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Django with Gunicorn different ways to deploy

I've been reading about deploying Django with gunicorn and I wanted to give it a try.

I have found at least 3 ways of running a server with gunicorn and django:

  1. gunicorn [OPTIONS] [APP_MODULE] # tested locally and worked fine
  2. python managy.py run_gunicorn # also works fine locally
  3. gunicorn_django [OPTIONS] [SETTINGS_PATH] # I have an error due to apps/ location

I have Apache with nginx (serving static files) in production at the moment, works fine but is a litle slow and want to try Gunicorn. The first 2 options worked fine locally with nginx serving static files.

I want to know a couple if things:

  1. What is the difference between any option above ?
  2. What is the proper instruction to run in PRODUCTION environments ?

Thank you guys.

like image 617
PepperoniPizza Avatar asked Feb 06 '13 17:02

PepperoniPizza


1 Answers

Use gunicorn_django [OPTIONS] myproject if you use myproject.settings

like image 55
kbec Avatar answered Sep 28 '22 00:09

kbec