【发布时间】:2019-02-14 01:20:17
【问题描述】:
我正在尝试在 Heroku 上部署 django 项目。我的设置是:
DEBUG = False
ALLOWED_HOSTS = ['*']
MIDDLEWARE = [
'whitenoise.middleware.WhiteNoiseMiddleware',]
STATIC_URL = '/static/'
STATICFILES_DIRS = (
os.path.join(BASE_DIR, 'startshop/static/'),
)
STATIC_ROOT = os.path.join(BASE_DIR, 'staticfiles')
STATICFILES_STORAGE = 'whitenoise.storage.CompressedManifestStaticFilesStorage'
import dj_database_url
DATABASES = {}
DATABASES['default'] = dj_database_url.config(conn_max_age=600, ssl_require=True)
Procfile 是 - "web: gunicorn startshop.wsgi --log-file -"
运行时是-“python-3.6.6”
WSGI 是 -
import os
from django.core.wsgi import get_wsgi_application
from whitenoise import WhiteNoise
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "startshop.settings")
application = get_wsgi_application()
application = WhiteNoise(application)
当我输入“heroku ps:scale web=1”时,我收到错误“Couldn't find that process type.”
【问题讨论】:
标签: django python-3.x heroku