Django [Mezzanine CMS] 项目未部署到 Heroku
Posted
技术标签:
【中文标题】Django [Mezzanine CMS] 项目未部署到 Heroku【英文标题】:Django [Mezzanine CMS] project not deploying to Heroku 【发布时间】:2013-09-30 16:09:20 【问题描述】:Python 新手,正在尝试部署博客。我跟着 Heorku 关于Getting Started with Python on Heroku 的文档。它提到我需要添加一个Procfile
,所以我添加了
过程文件
web: gunicorn hello:app
提交,但在尝试将我的应用部署到 heroku 时遇到此错误
Juan-Gallardos-MacBook-Pro:yatumblrgraffiti juangallardo$ git push heroku master
Counting objects: 23, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (18/18), done.
Writing objects: 100% (23/23), 15.50 KiB, done.
Total 23 (delta 2), reused 0 (delta 0)
-----> Python app detected
-----> No runtime.txt provided; assuming python-2.7.4.
-----> Preparing Python runtime (python-2.7.4)
-----> Installing Distribute (0.6.36)
-----> Installing Pip (1.3.1)
-----> Installing dependencies using Pip (1.3.1)
Downloading/unpacking Django==1.5.1 (from -r requirements.txt (line 1))
Running setup.py egg_info for package Django
Downloading/unpacking Mezzanine==1.4.14 (from -r requirements.txt (line 2))
Running setup.py egg_info for package Mezzanine
Downloading/unpacking Pillow==2.1.0 (from -r requirements.txt (line 3))
Running setup.py egg_info for package Pillow
warning: no files found matching 'COPYING'
warning: no files found matching '*.html' under directory 'docs'
warning: no files found matching '*.css' under directory 'docs'
warning: no files found matching 'README' under directory 'docs'
warning: no files found matching 'CHANGES' under directory 'docs'
warning: no files found matching 'CONTENTS' under directory 'docs'
Downloading/unpacking PyRSS2Gen==1.0.0 (from -r requirements.txt (line 4))
Downloading PyRSS2Gen-1.0.0.tar.gz
Running setup.py egg_info for package PyRSS2Gen
Downloading/unpacking Twisted==11.0.0 (from -r requirements.txt (line 5))
Running setup.py egg_info for package Twisted
Downloading/unpacking altgraph==0.7.2 (from -r requirements.txt (line 6))
Downloading altgraph-0.7.2.tar.gz
Running setup.py egg_info for package altgraph
warning: no files found matching '*.txt'
Downloading/unpacking bdist-mpkg==0.4.4 (from -r requirements.txt (line 7))
Downloading bdist_mpkg-0.4.4.tar.gz
Running setup.py egg_info for package bdist-mpkg
Downloading/unpacking bleach==1.2.2 (from -r requirements.txt (line 8))
Downloading bleach-1.2.2.tar.gz
Running setup.py egg_info for package bleach
Downloading/unpacking bonjour-py==0.3 (from -r requirements.txt (line 9))
Could not find any downloads that satisfy the requirement bonjour-py==0.3 (from -r requirements.txt (line 9))
No distributions at all found for bonjour-py==0.3 (from -r requirements.txt (line 9))
Storing complete log in /app/.pip/pip.log
! Push rejected, failed to compile Python app
To git@heroku.com:yatumblrgraffiti.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'git@heroku.com:yatumblrgraffiti.git'
当我运行heroku logs
时,我得到了这个
Juan-Gallardos-MacBook-Pro:yatumblrgraffiti juangallardo$ heroku logs
2013-09-25T06:48:50+00:00 heroku[slug-compiler]: Slug compilation started
2013-09-25T06:49:16+00:00 heroku[slug-compiler]: Slug compilation failed: failed to compile Python app
2013-09-25T06:56:42.862309+00:00 heroku[router]: at=info code= desc="Blank app" method=GET path=/favicon.ico host=yatumblrgraffiti.herokuapp.com fwd="98.189.25.230" dyno= connect= service= status=502 bytes=
2013-09-25T06:56:42.221149+00:00 heroku[router]: at=info code= desc="Blank app" method=GET path=/ host=yatumblrgraffiti.herokuapp.com fwd="98.189.25.230" dyno= connect= service= status=502 bytes=
2013-09-25T06:56:42.775650+00:00 heroku[router]: at=info code= desc="Blank app" method=GET path=/favicon.ico host=yatumblrgraffiti.herokuapp.com fwd="98.189.25.230" dyno= connect= service= status=502 bytes=
2013-09-25T07:00:59+00:00 heroku[slug-compiler]: Slug compilation started
2013-09-25T07:01:51+00:00 heroku[slug-compiler]: Slug compilation failed: failed to compile Python app
2013-09-26T04:19:23+00:00 heroku[slug-compiler]: Slug compilation started
2013-09-26T04:19:48+00:00 heroku[slug-compiler]: Slug compilation failed: failed to compile Python app
不是How to deploy mezzanine on heroku? 的重复项,因为该问题具有不同的 Procfile 并且不包括他的错误日志。
我会在这里遗漏什么?
【问题讨论】:
我本人对 Heroku 并不熟悉,但如果您无法在这里找到答案并且您还没有这样做,那么我强烈建议您发布到 Mezzanine Google 小组。 groups.google.com/forum/#!forum/mezzanine-users 我在这里问了一个问题***.com/questions/20737960/…,这可能对您有用吗?我希望有人能帮助你。我不明白为什么 procfile 一直不起作用。 【参考方案1】:altgraph==0.7.1
包似乎存在问题,因此只需更新您的requirements.txt
以指向altgraph==0.7.2
或更高版本。
来源:发布历史https://pypi.python.org/pypi/altgraph/
【讨论】:
谢谢,您的回答确实让我更接近了。问题详情已编辑。【参考方案2】:找不到标识为 bonjour-py 的包。
pip search bonjour
显示包名
pybonjour
运行
pip install pybonjour
pip freeze > requirements.txt
然后再次提交并推送到 Heroku。
此外,您之前对 altgraph 的问题表明您可能想要做一个
pip install -U <packagename>
在推送新的 requirements.txt 之前为你所有的包
如果您想查看当前使用的软件包版本,请执行以下操作
pip freeze
【讨论】:
以上是关于Django [Mezzanine CMS] 项目未部署到 Heroku的主要内容,如果未能解决你的问题,请参考以下文章
无法使用自定义用户和 Mezzanine/South 登录到 Django Admin
在Django Mezzanine中,如何防止在page_processor上进行缓存?
Mezzanine (Windows10下)安装配置与修改(更新中)