django - 在 Heroku 上部署 Django cms

标签 django heroku django-cms

我正在尝试在 Heruku 上部署 Django CMS。 我按照 https://devcenter.heroku.com/articles/git 上的说明进行操作- 但是当我运行最后一个命令时,结果是:

(web1)users-imac:1web user$ git push heroku master
Counting objects: 453, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (439/439), done.
Writing objects: 100% (453/453), 1.21 MiB | 105 KiB/s, done.
Total 453 (delta 30), reused 0 (delta 0)

-----> Removing .DS_Store files

! Push rejected, no Cedar-supported app detected

To <a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="63040a17230b06110c08164d000c0e" rel="noreferrer noopener nofollow">[email protected]</a>:intense-oasis-8026.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to '<a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="385f514c78505d4a57534d165b5755" rel="noreferrer noopener nofollow">[email protected]</a>:intense-oasis-8026.git'

所以我猜出了什么问题,但不确定是什么。

那些我的heroku登录输出:

 2013-07-07T14:20:41.610222+00:00 heroku[api]: Enable Logplex by <a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="71101d14095f161003041d1d1831161c10181d5f121e1c" rel="noreferrer noopener nofollow">[email protected]</a>
 2013-07-07T14:20:41.623083+00:00 heroku[api]: Release v2 created by <a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="60010c05184e070112150c0c0920070d01090c4e030f0d" rel="noreferrer noopener nofollow">[email protected]</a>
 2013-07-07T14:21:18+00:00 heroku[slug-compiler]: Slug compilation started
 2013-07-07T14:21:21+00:00 heroku[slug-compiler]: Slug compilation failed: no Cedar-supported app detected
 2013-07-07T14:22:25.296159+00:00 heroku[router]: at=info code= desc="Blank app"    method=GET path=/ host=intense-oasis-8026.herokuapp.com fwd="86.161.229.49" dyno= connect=   service= status=502 bytes=
 2013-07-07T14:22:25.474698+00:00 heroku[router]: at=info code= desc="Blank app" method=GET path=/favicon.ico host=intense-oasis-8026.herokuapp.com fwd="86.161.229.49" dyno= connect= service= status=502 bytes=
 2013-07-07T21:53:38.496649+00:00 heroku[router]: at=info code= desc="Blank app" method=GET path=/ host=intense-oasis-8026.herokuapp.com fwd="120.168.1.115" dyno= connect= service= status=502 bytes=
 2013-07-07T21:53:48.291460+00:00 heroku[router]: at=info code= desc="Blank app" method=GET path=/favicon.ico host=intense-oasis-8026.herokuapp.com fwd="120.168.1.115" dyno= connect= service= status=502 bytes=
 2013-07-07T21:53:51.282218+00:00 heroku[router]: at=info code= desc="Blank app" method=GET path=/favicon.ico host=intense-oasis-8026.herokuapp.com fwd="120.168.1.115" dyno= connect= service= status=502 bytes=
 2013-07-08T18:29:16+00:00 heroku[slug-compiler]: Slug compilation started
 2013-07-08T18:29:17+00:00 heroku[slug-compiler]: Slug compilation failed: no Cedar-  supported app detected

好的,我的 Procfile 工作了,由工头开始

20:30:16 web.1  | started with pid 13580
20:30:16 web.1  | /usr/local/foreman/bin/foreman-runner: line 41: exec: gunicorn: not  found
20:30:16 web.1  | exited with code 127 
20:30:16 system | sending SIGTERM to all processes
SIGTERM received

但 git push heroku master 的结果相同

更新

我想我的 git push heroku master 工作了......或者至少加载了很多东西......但知道我的页面中有

Application Error An 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

你可以在https://bitbucket.org/agarulli/trydj/src查看我的所有代码

请问有什么想法吗?

最佳答案

确保 gunicorn & dj-database-url 位于您的requirements.txt 文件中,并将其添加到您的settings.py 文件中:

INSTALLED_APPS = (
    ...
    'gunicorn',
    ...
)

import dj_database_url
DATABASES['default'] = dj_database_url.config()

选择一个并更改您的 Procfile,如下所示:

web: gunicorn YOUR_PROJECT_NAME.wsgi -b 0.0.0.0:$PORT

(将 YOUR_PROJECT_NAME 更改为您的项目名称)

web: python manage.py runserver 0.0.0.0:$PORT --noreload

(如果您不想使用 Gunicorn 服务器)。

使用 Virtualenv 运行以下命令重新创建新的存储库和新的 cedar:

workon YOUR_PROJECT
pip freeze > requirements.txt
rm -rf .git
git init
git add .
git commit -am "YOUR COMMIT"
heroku create --stack cedar
git push heroku master

使用此命令同步数据库:

heroku run python manage.py syncdb

打开您的应用程序:

heroku open

关于django - 在 Heroku 上部署 Django cms,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17513408/

相关文章:

php - 如何在开源(Github + Heroku)应用程序中保护 Google API Key

python - Django-CMS:同一项目中的多个域

django - 如何通过日志过滤掉 GET 静态和媒体消息?

python - 更改 Django TimeInput 中的默认时间

python - Django-mptt 模型序列化与 Django REST 框架

java - 在 heroku 上调试嵌入式 tomcat

git - 使用 git push 保存 .sqlite

django - 是否可以在非 CMS 应用程序中显示 Django-CMS 菜单?

django - 如何在基于 django 的网站上使用 wordpress 博客主题

django - 如何将模型重新分配给不同的应用程序以仅在 Django Admin 中显示