Heroku无法发现python是必要的

时间:2017-05-14 09:02:40

标签: django heroku

我有一个项目,其结构类似于Django的两个Scoops中描述的结构。

即: 1. photoarchive_project是存储库根目录(其中.git存在)。 这个项目本身就是一个照片。 3.配置文件是分开的,用于不同的现实。

追溯和其他信息如下。

文件runtime.txt位于.git目录旁边。那是在初始化git的目录中。

问题是:它甚至无法确定应该应用python。你能帮我一把吗?

的.git /配置

[core]
    repositoryformatversion = 0
    filemode = true
    bare = false
    logallrefupdates = true
[remote "origin"]
    url = ssh://git@bitbucket.org/Kifsif/photoarchive.git
    fetch = +refs/heads/*:refs/remotes/origin/*
[branch "master"]
    remote = origin
    merge = refs/heads/master
[remote "heroku"]
    url = https://git.heroku.com/powerful-plains-97572.git
    fetch = +refs/heads/*:refs/remotes/heroku/*

回溯

(photoarchive) michael@ThinkPad:~/workspace/photoarchive_project$ git push 

    heroku master
    Counting objects: 3909, done.
    Delta compression using up to 4 threads.
    Compressing objects: 100% (3617/3617), done.
    Writing objects: 100% (3909/3909), 686.44 KiB | 0 bytes/s, done.
    Total 3909 (delta 2260), reused 0 (delta 0)
    remote: Compressing source files... done.
    remote: Building source:
    remote: 
    remote:  !     No default language could be detected for this app.
    remote:             HINT: This occurs when Heroku cannot detect the buildpack to use for this application automatically.
    remote:             See https://devcenter.heroku.com/articles/buildpacks
    remote: 
    remote:  !     Push failed
    remote: Verifying deploy...
    remote: 
    remote: !   Push rejected to powerful-plains-97572.
    remote: 
    To https://git.heroku.com/powerful-plains-97572.git
     ! [remote rejected] master -> master (pre-receive hook declined)
    error: failed to push some refs to 'https://git.heroku.com/powerful-plains-97572.git'

(photoarchive) michael@ThinkPad:~/workspace/photoarchive_project$ tree
.
├── docs
├── media
├── photoarchive
│   ├── config
│   │   ├── settings
│   │   │   ├── base.py
│   │   │   ├── constants.py
│   │   │   ├── heroku.py
│   │   │   ├── __init__.py
│   │   │   ├── local.py
│   │   │   └── production.py
│   └── manage.py
├── .git
├── .gitignore
├── Procfile
└── runtime.txt

runtime.txt

python-3.6.1

1 个答案:

答案 0 :(得分:1)

您需要在项目文件夹的根目录中定义requirements.txt。此文件应包含所有项目依赖项的列表。

您可以通过运行以下命令在本地开发计算机上生成此文件:

$ pip freeze > requirements.txt

然后将其检入版本控制,并将其推送到Heroku。

Heroku查找此文件以确定您的应用程序实际上是Python应用程序=)