Probleme mit Konfiguration der Bereitstellung mit Heroku/gunicorn/django

Ich versuche mein django-Anwendung auf heroku.

Ordner-Struktur:

app/
  Procfile
  docs/
  ...
  project/
    manage.py
    wsgi.py
    <django apps>

Procfile

web: gunicorn --pythonpath="$PWD/project" wsgi:application --log-file=-

Fehler, die ich immer bin:

2015-02-16T16:05:00.646316+00:00 heroku[web.1]: Starting process with command `gunicorn --pythonpath="$PWD/project" wsgi:application --log-file=-`
2015-02-16T16:05:02.697633+00:00 app[web.1]: [2015-02-16 16:05:02 +0000] [3] [INFO] Listening at: http://0.0.0.0:44846 (3)
2015-02-16T16:05:02.709567+00:00 app[web.1]: [2015-02-16 16:05:02 +0000] [9] [INFO] Booting worker with pid: 9
2015-02-16T16:05:02.696968+00:00 app[web.1]: [2015-02-16 16:05:02 +0000] [3] [INFO] Starting gunicorn 19.1.1
2015-02-16T16:05:02.697790+00:00 app[web.1]: [2015-02-16 16:05:02 +0000] [3] [INFO] Using worker: sync
2015-02-16T16:05:02.793753+00:00 app[web.1]: [2015-02-16 16:05:02 +0000] [10] [INFO] Booting worker with pid: 10
2015-02-16T16:05:03.157305+00:00 app[web.1]: Traceback (most recent call last):
2015-02-16T16:05:03.157311+00:00 app[web.1]:   File "/app/.heroku/python/bin/gunicorn", line 11, in <module>
2015-02-16T16:05:03.157351+00:00 app[web.1]:     sys.exit(run())
2015-02-16T16:05:03.157383+00:00 app[web.1]:   File "/app/.heroku/python/lib/python2.7/site-packages/gunicorn/app/wsgiapp.py", line 74, in run
2015-02-16T16:05:03.157461+00:00 app[web.1]:     WSGIApplication("%(prog)s [OPTIONS] [APP_MODULE]").run()
2015-02-16T16:05:03.157463+00:00 app[web.1]:   File "/app/.heroku/python/lib/python2.7/site-packages/gunicorn/app/base.py", line 185, in run
2015-02-16T16:05:03.157506+00:00 app[web.1]:     super(Application, self).run()
2015-02-16T16:05:03.157527+00:00 app[web.1]:   File "/app/.heroku/python/lib/python2.7/site-packages/gunicorn/app/base.py", line 71, in run
2015-02-16T16:05:03.157604+00:00 app[web.1]:     Arbiter(self).run()
2015-02-16T16:05:03.157607+00:00 app[web.1]:   File "/app/.heroku/python/lib/python2.7/site-packages/gunicorn/arbiter.py", line 196, in run
2015-02-16T16:05:03.157635+00:00 app[web.1]:     self.halt(reason=inst.reason, exit_status=inst.exit_status)
2015-02-16T16:05:03.157656+00:00 app[web.1]:   File "/app/.heroku/python/lib/python2.7/site-packages/gunicorn/arbiter.py", line 292, in halt
2015-02-16T16:05:03.157730+00:00 app[web.1]:     self.stop()
2015-02-16T16:05:03.157744+00:00 app[web.1]:   File "/app/.heroku/python/lib/python2.7/site-packages/gunicorn/arbiter.py", line 343, in stop
2015-02-16T16:05:03.157814+00:00 app[web.1]:     time.sleep(0.1)
2015-02-16T16:05:03.157836+00:00 app[web.1]:   File "/app/.heroku/python/lib/python2.7/site-packages/gunicorn/arbiter.py", line 209, in handle_chld
2015-02-16T16:05:03.157887+00:00 app[web.1]:     self.reap_workers()
2015-02-16T16:05:03.157908+00:00 app[web.1]:   File "/app/.heroku/python/lib/python2.7/site-packages/gunicorn/arbiter.py", line 459, in reap_workers
2015-02-16T16:05:03.158009+00:00 app[web.1]:     raise HaltServer(reason, self.WORKER_BOOT_ERROR)
2015-02-16T16:05:03.158075+00:00 app[web.1]: gunicorn.errors.HaltServer: <HaltServer 'Worker failed to boot.' 3>
2015-02-16T16:05:03.904714+00:00 heroku[web.1]: Process exited with status 1
2015-02-16T16:05:03.914410+00:00 heroku[web.1]: State changed from starting to crashed

Update 1
Meine wsgi.py Datei

import os

os.environ.setdefault("DJANGO_SETTINGS_MODULE", "config")
os.environ.setdefault("DJANGO_CONFIGURATION", "Production")

from configurations.wsgi import get_wsgi_application
application = get_wsgi_application()

Hier bin ich nur hinzufügen von text, weil SO hat diese dumme minimale Menge an text, der geschrieben werden müssen, in Frage. Ich meine, ich bekomme es, die Qualität muss gehalten werden, aber wenn das problem ist selbsterklärend, warum die Menschen zwingen, zu schreiben, nicht mehr benötigte text? Vielen Dank und einen schönen Tag!

  • Wie haben Sie Ihre WSGI-Datei dorthin zu gelangen, statt im innen-Projekt/project, die ist, wo Django bringt es? Und sollten Sie den Inhalt der Datei.
  • Ich zog wsgi.py der Hauptordner des Projekts, glauben Sie, dass dies das Problem ist?
  • Es gibt zu viel wissen wir nicht hier. Was ist die "config" als DJANGO_SETTINGS_MODULE? Haben Sie wirklich aufgerufen, Ihre Einstellungen Datei config.py statt settings.py? Und ist es im gleichen Verzeichnis wie wsgi.py?
  • Ich bin mit pydanny die cookiecutter-Projekt-Vorlage wie hier: github.com/pydanny/cookiecutter-django settings.py Datei(en) sind im eigenen Ordner namens config und Namen common.py für die Basis-Einstellungen und dann local.py oder production.py verwendet in locale oder Produktionsumgebungen
InformationsquelleAutor Avi Meir | 2015-02-16
Schreibe einen Kommentar