我的Python版本3.5.2是Django部署在Heroku
Django的版本是1.8.13
我做了一個Django應用程序,並想dploy到的Heroku。
當我輸入heroku open
然後本地服務器顯示應用程序錯誤。
谷歌搜索後。
我修復了我的wsgi.py,但仍然錯誤。
.ImproperlyConfigured: Requested setting CACHES, but settings are not configured.
You must either define the environment variable DJANGO_SETTINGS_MODULE or call settings.configure() before accessing settings.
"'DJANGO_SETTINGS_MODULE' environment variable must be set
"django.core.exceptions.ImproperlyConfigured: 'DJANGO_SETTINGS_MODULE' environment variable must be set before importing 'whitenoise.django'
File "/app/.heroku/python/lib/python3.5/site-packages/gunicorn/arbiter.py", line 506, in reap_workers raise HaltServer(reason, self.WORKER_BOOT_ERROR)
gunicorn.errors.HaltServer: <HaltServer 'Worker failed to boot.' 3>
wsgi.py
import os
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "weather_station.settings")
from django.core.wsgi import get_wsgi_application
from whitenoise.django import DjangoWhiteNoise
application = DjangoWhiteNoise(get_wsgi_application())
有什麼重要的概念我錯過了什麼?
[UPDATE]
procfile
web: gunicorn weather_station.wsgi --pythonpath weather_station
請顯示您的Procfile。 –