【问题标题】:how to fix heroku "Application error" where console error "code=H14 desc="No web processes running"如何修复heroku“应用程序错误”,其中控制台错误“code = H14 desc =“No web processes running”
【发布时间】: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


    【解决方案1】:

    真丢脸。原因是 procfile 文件名的大写字母。我变了

    procfile 到 Prockfile

    我的应用程序启动了。

    【讨论】:

    • 里面有k吗?还是Procfile
    • 不确定。原因是第一个大写字母
    猜你喜欢
    • 2021-03-19
    • 2021-10-10
    • 2021-04-07
    • 2020-02-05
    • 1970-01-01
    • 1970-01-01
    • 2014-08-25
    • 1970-01-01
    • 2020-12-13
    相关资源
    最近更新 更多