PepperoniPizza
PepperoniPizza

Reputation: 9112

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.

Upvotes: 6

Views: 513

Answers (1)

kbec
kbec

Reputation: 3465

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

Upvotes: 1

Related Questions