murtaza52
murtaza52

Reputation: 47431

unable to run django app using foreman and gunicorn

I am trying to run my django app using gunicorn and foreman. I can successfully run it using python manage.py server. However when running it using forman it fails -

15:32:01 web.1  | started with pid 29188
15:32:01 web.1  | 2012-08-16 15:32:01 [29191] [INFO] Starting gunicorn 0.14.6
15:32:01 web.1  | 2012-08-16 15:32:01 [29191] [INFO] Listening at: http://127.0.0.1:8000 (29191)
15:32:01 web.1  | 2012-08-16 15:32:01 [29191] [INFO] Using worker: sync
15:32:01 web.1  | 2012-08-16 15:32:01 [29194] [INFO] Booting worker with pid: 29194
15:32:01 web.1  | 2012-08-16 15:32:01 [29194] [INFO] Worker exiting (pid: 29194)
15:32:02 web.1  | 2012-08-16 15:32:02 [29191] [INFO] Shutting down: Master
15:32:02 web.1  | 2012-08-16 15:32:02 [29191] [INFO] Reason: Worker failed to boot.
15:32:02 web.1  | exited with code 3

Below is the contents of the Procfile -

web: gunicorn tms.wsgi

I have been following the instructions given on heroku for setting it up.

Upvotes: 4

Views: 3073

Answers (3)

khirod
khirod

Reputation: 345

If you are facing trouble following the Heroku Documentation then you may check my sample app deployed to Heroku https://github.com/shinigamiryuk/Django-Heroku-Sample-Application

Upvotes: 0

Eric
Eric

Reputation: 36

What directory is your settings.py file located in in which you added 'gunicorn' to your INSTALLED_APPS? I'm assuming you're following the Heroku Getting Started with Django tutorial. The .wsgi file you state in your Procfile should match with that directory which you have your settings.py in.

Your Procfile should be:

    web: gunicorn <directory_containing_settings.py_file>.wsgi -b 0.0.0.0:$PORT

Upvotes: 0

mipadi
mipadi

Reputation: 410662

What instructions are you following? I run Django apps on Heroku using this:

web: python django_project/manage.py run_gunicorn -b "0.0.0.0:$PORT" -w 3 -k gevent --preload

Upvotes: 4

Related Questions