打开APP
userphoto
未登录

开通VIP,畅享免费电子书等14项超值服

开通VIP
python-Heroku上的夹层

我正在尝试在Heroku上建立Mezzanine(Django)应用程序.我在项目中的应用程序中有一个自定义主题.

我从herokuapp网站收到此错误:

Application ErrorAn error occurred in the application and your page could not be served. Please try again in a few moments.If you are the application owner, check your logs for details.

我从“ heroku日志”中收到此错误:

2014-03-01T03:16:46.703103 00:00 heroku[web.1]: State changed from crashed to starting2014-03-01T03:16:52.887091 00:00 heroku[web.1]: Starting process with command `python manage.py collectstatic --noinput; python manage.py run_gunicorn -b 0.0.0.0:48220`2014-03-01T03:16:54.917679 00:00 app[web.1]: /app/.heroku/python/lib/python2.7/site-packages/mezzanine/utils/conf.py:59: UserWarning: TIME_ZONE setting is not set, using closest match: Etc/UTC2014-03-01T03:16:54.917679 00:00 app[web.1]:   warn("TIME_ZONE setting is not set, using closest match: %s" % tz)2014-03-01T03:16:54.945927 00:00 app[web.1]: Unknown command: 'collectstatic'2014-03-01T03:16:54.945927 00:00 app[web.1]: Type 'manage.py help' for usage.2014-03-01T03:16:55.283913 00:00 app[web.1]:   warn("TIME_ZONE setting is not set, using closest match: %s" % tz)2014-03-01T03:16:55.283913 00:00 app[web.1]: /app/.heroku/python/lib/python2.7/site-packages/mezzanine/utils/conf.py:59: UserWarning: TIME_ZONE setting is not set, using closest match: Etc/UTC2014-03-01T03:16:55.299183 00:00 app[web.1]: Type 'manage.py help' for usage.2014-03-01T03:16:55.299183 00:00 app[web.1]: Unknown command: 'run_gunicorn'2014-03-01T03:16:57.198274 00:00 heroku[web.1]: Process exited with status 12014-03-01T03:16:57.211687 00:00 heroku[web.1]: State changed from starting to crashed2014-03-01T03:16:57.213010 00:00 heroku[web.1]: State changed from crashed to starting2014-03-01T03:17:02.491996 00:00 heroku[web.1]: Starting process with command `python manage.py collectstatic --noinput; python manage.py run_gunicorn -b 0.0.0.0:48145`2014-03-01T03:17:04.444781 00:00 app[web.1]: /app/.heroku/python/lib/python2.7/site-packages/mezzanine/utils/conf.py:59: UserWarning: TIME_ZONE setting is not set, using closest match: Etc/UTC2014-03-01T03:17:04.472595 00:00 app[web.1]: Type 'manage.py help' for usage.2014-03-01T03:17:04.444781 00:00 app[web.1]:   warn("TIME_ZONE setting is not set, using closest match: %s" % tz)2014-03-01T03:17:04.472595 00:00 app[web.1]: Unknown command: 'collectstatic'2014-03-01T03:17:04.992615 00:00 app[web.1]: /app/.heroku/python/lib/python2.7/site-packages/mezzanine/utils/conf.py:59: UserWarning: TIME_ZONE setting is not set, using closest match: Etc/UTC2014-03-01T03:17:04.992615 00:00 app[web.1]:   warn("TIME_ZONE setting is not set, using closest match: %s" % tz)2014-03-01T03:17:05.080366 00:00 app[web.1]: Unknown command: 'run_gunicorn'2014-03-01T03:17:05.080366 00:00 app[web.1]: Type 'manage.py help' for usage.2014-03-01T03:17:06.827562 00:00 heroku[web.1]: Process exited with status 12014-03-01T03:17:06.842272 00:00 heroku[web.1]: State changed from starting to crashed2014-03-01T03:17:08.397089 00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path=/ host=appname request_id=b2f6e7d5-9979-472d-b480-ca36a602f146 fwd="130.126.175.201" dyno= connect= service= status=503 bytes=

这是我在settings.py中安装的应用程序var(抄送是我的主题/应用程序名称):

INSTALLED_APPS = (    "cc",    "django.contrib.admin",    "django.contrib.auth",    "django.contrib.contenttypes",    "django.contrib.redirects",    "django.contrib.sessions",    "django.contrib.sites",    "django.contrib.sitemaps",    "django.contrib.staticfiles",    "mezzanine.boot",    "mezzanine.conf",    "mezzanine.core",    "mezzanine.generic",    "mezzanine.blog",    "mezzanine.forms",    "mezzanine.pages",    "mezzanine.galleries",    "mezzanine.twitter",    #"mezzanine.accounts",    #"mezzanine.mobile",    "gunicorn",)

我的requirements.txt中包含金枪鱼.另外,run_gunicorn和collectstatic都可以从我的venv内部进行本地工作.为什么会这样呢?我按照以下步骤操作:urls.py为https://gist.github.com/joshfinnie/4046138(请注意,我的requirements.txt是通过pip Frozen> requirements.txt生成的,因此是最新的).

这是我的Procfile:

web: python manage.py collectstatic --noinput; python manage.py run_gunicorn -b 0.0.0.0:$PORT

解决方法:

您的Procfile是与settings.py/manage.py位于同一路径还是位于外部?我遇到了类似的问题,并将我的配置文件在您的项目目录中上移了一层.这是领班在普通Django项目上执行的方式.但是,我正在使用wsgi运行它.

这是我的Procfile

程序文件:
    网址:python manage.py collectstatic –noinput; gunicorn your_project.wsgi -b 0.0.0.0:$PORT

来源:https://www.icode9.com/content-1-534101.html
本站仅提供存储服务,所有内容均由用户发布,如发现有害或侵权内容,请点击举报
打开APP,阅读全文并永久保存 查看更多类似文章
猜你喜欢
类似文章
【热】打开小程序,算一算2024你的财运
Mezzanine 教你一分钟搭建Python CMS系统
模型(Models)和管理后台(Admin site)
Django 模型(数据库)
Django-最流行的Python WEB框架
Django3 学习记录笔记 | 国光
django+django
更多类似文章 >>
生活服务
热点新闻
分享 收藏 导长图 关注 下载文章
绑定账号成功
后续可登录账号畅享VIP特权!
如果VIP功能使用有故障,
可点击这里联系客服!

联系客服