【问题标题】:Getting error while deploying Django app in the Heroku在 Heroku 中部署 Django 应用程序时出错
【发布时间】:2017-09-20 02:46:09
【问题描述】:

我有一个 Django 项目,我第一次尝试在 Heroku 云。项目结构如下,

# Project structure:

.\Project folder\ -
                |
                |- .\env\ (Virtual enviroment )
                |
                |- .\src\ -
                |          |
                |          |- .\main\ -
                |          |           |
                |          |           |- admin.py  (Output tables data in to admin dashboard)
                |          |           |- models.py (Classes os DB tables)
                |          |           |- serializers.py (Serializing of data output in API)
                |          |           |- views.py (Custome API views)
                |          |           |- ...
                |          |
                |          |- .\users_groups\ -
                |          |                   |
                |          |                   |- settings.py (Project settings)
                |          |                   |- urls.py ( file with URL's reg. ex. patterns)
                |          |                   |- wsgi.py
                |          |
                |          |- .\templates\ 
                |          |
                |          |- manage.py
                |          |- db.sqlite3
                |
                |- .\app-messages
                |
                |- ReadMe.txt 
                |
                |- requirements.txt (file with list of all dependencies for app)

我的project 在这里,我遵循了this 教程。我在.\Project folder\ 里面,在pushing 在主人里面的时候,我得到了一些错误。我用命令推送,

git push heroku master

我收到错误消息,

To https://git.heroku.com/i2x-team-app.git
 ! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/i2x-team-app.git'

我应该怎么做才能解决这个问题?

【问题讨论】:

  • tru push 到另一个分支
  • 什么意思?我知道 Git,但这是我第一次使用 Heroku。
  • Procfile 在哪里?
  • 我在 Github 中推送 repo 后在项目中添加了Procfile。有关系吗?顺便说一句,我刚刚在 Github 推送了更新版本(包括Procfile),你可以看到它。

标签: python django heroku


【解决方案1】:

试试这个

heroku buildpacks:set heroku/python

然后推

【讨论】:

    猜你喜欢
    • 2021-04-28
    • 2018-02-09
    • 2015-10-09
    • 2019-06-25
    • 2018-12-25
    • 2013-07-04
    • 1970-01-01
    • 2021-05-16
    相关资源
    最近更新 更多