如何修复heroku“应用程序错误”,其中控制台错误“ code = H14 desc =“没有正在运行的Web进程”

时间:2018-09-09 10:43:52

标签: django python-3.x heroku

我正在尝试在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.

1 个答案:

答案 0 :(得分:0)

对我感到羞耻。原因是procfile文件名的大写字母。我改变了

  

procfile转换为 P rockfile

我的应用启动。