Ich versuche, Foreman/Honcho zu verwenden, um meine Procfile-basierte Django-Anwendung zu verwalten. Wenn ich die App starte die normale python manage.py runserver
anzeigen, funktioniert alles gut. Allerdings, wenn ich die App über honcho start
oder foreman start web
starten, erhalte ich diesen Fehler:Django - Foreman kann installierte Modelle nicht finden
11:59:31 system | web.1 started (pid=27959)
11:59:31 web.1 | [2016-04-26 11:59:31 -0700] [27959] [INFO] Starting gunicorn 19.4.5
11:59:31 web.1 | [2016-04-26 11:59:31 -0700] [27959] [INFO] Listening at: http://0.0.0.0:5000 (27959)
11:59:31 web.1 | [2016-04-26 11:59:31 -0700] [27959] [INFO] Using worker: sync
11:59:31 web.1 | [2016-04-26 11:59:31 -0700] [27962] [INFO] Booting worker with pid: 27962
11:59:31 web.1 | [2016-04-26 18:59:31 +0000] [27962] [ERROR] Exception in worker process:
11:59:31 web.1 | Traceback (most recent call last):
11:59:31 web.1 | File "/Library/Python/2.7/site-packages/gunicorn/arbiter.py", line 515, in spawn_worker
11:59:31 web.1 | worker.init_process()
11:59:31 web.1 | File "/Library/Python/2.7/site-packages/gunicorn/workers/base.py", line 122, in init_process
11:59:31 web.1 | self.load_wsgi()
11:59:31 web.1 | File "/Library/Python/2.7/site-packages/gunicorn/workers/base.py", line 130, in load_wsgi
11:59:31 web.1 | self.wsgi = self.app.wsgi()
11:59:31 web.1 | File "/Library/Python/2.7/site-packages/gunicorn/app/base.py", line 67, in wsgi
11:59:31 web.1 | self.callable = self.load()
11:59:31 web.1 | File "/Library/Python/2.7/site-packages/gunicorn/app/wsgiapp.py", line 65, in load
11:59:31 web.1 | return self.load_wsgiapp()
11:59:31 web.1 | File "/Library/Python/2.7/site-packages/gunicorn/app/wsgiapp.py", line 52, in load_wsgiapp
11:59:31 web.1 | return util.import_app(self.app_uri)
11:59:31 web.1 | File "/Library/Python/2.7/site-packages/gunicorn/util.py", line 357, in import_app
11:59:31 web.1 | __import__(module)
11:59:31 web.1 | File "../wsgi.py", line 17, in <module>
11:59:31 web.1 | application = get_wsgi_application()
11:59:31 web.1 | File "/Library/Python/2.7/site-packages/django/core/wsgi.py", line 13, in get_wsgi_application
11:59:31 web.1 | django.setup()
11:59:31 web.1 | File "/Library/Python/2.7/site-packages/django/__init__.py", line 18, in setup
11:59:31 web.1 | apps.populate(settings.INSTALLED_APPS)
11:59:31 web.1 | File "/Library/Python/2.7/site-packages/django/apps/registry.py", line 85, in populate
11:59:31 web.1 | app_config = AppConfig.create(entry)
11:59:31 web.1 | File "/Library/Python/2.7/site-packages/django/apps/config.py", line 90, in create
11:59:31 web.1 | module = import_module(entry)
11:59:31 web.1 | File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/importlib/__init__.py", line 37, in import_module
11:59:31 web.1 | __import__(name)
11:59:31 web.1 | ImportError: No module named django_messages
11:59:31 web.1 | [2016-04-26 18:59:31 +0000] [27962] [INFO] Worker exiting (pid: 27962)
11:59:31 web.1 | [2016-04-26 11:59:31 -0700] [27959] [INFO] Shutting down: Master
11:59:31 web.1 | [2016-04-26 11:59:31 -0700] [27959] [INFO] Reason: Worker failed to boot.
11:59:31 system | web.1 stopped (rc=3)
Dies ist mit dem Versuch, die django-message Modul zu installieren. Ich habe dieselben Probleme mit anderen Modulen. Ich laufe auch in das gleiche Problem mit django-webpack-loader. Ich sollte auch erwähnen, dass ich den Fehler sowohl innerhalb eines virtualenv als auch wenn es deaktiviert ist.
Hier ist der Befehl für die Installation von django-Nachrichten:
$> pip install django-messages
Requirement already satisfied (use --upgrade to upgrade): django-messages in ./lib/python2.7/site-packages
Installierte Apps;
INSTALLED_APPS = (
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'my_app',
'django_messages',
)
Ich bin mir nicht sicher, was andere Informationen, die ich beheben zu helfen, zur Verfügung stellen kann, aber die grundlegende Frage ist, wie ich apps installiert mit Vorarbeiter/Boss zu arbeiten?
Es scheint, dass die Python-Instanz zwischen der Konsole und 'honcho' unterscheidet. Verwenden Sie virtualenv? –
Ich mache .. Ich bekomme den gleichen Fehler für beide innerhalb der virtualenv und damit deaktiviert fwiw. – dperconti
Ich verstehe. Dann scheint es, dass der 'Honcho' das System Python benutzt. In der Zwischenzeit installieren Sie die Bibliothek auf dem Virtualenv. –