开发环境为wsl(debian),python3.9.0,虚拟环境为“venv”。
我在这里提到:
https://tutorial-extensions.djangogirls.org/ja/heroku/
在这段代码之前就完成了:
git push heroku master
运行git push heroku master
,
然后我收到以下错误:
(env) me@Ver:~/docker_heroku/djangogirls210307$ git push heroku master
Enumerating objects: 78, done.
Counting objects: 100% (78/78), done.
Delta compression using up to 4 threads
Compressing objects: 100% (64/64), done.
Writing objects: 100% (78/78), 25.08 KiB | 885.00 KiB/s, done.
Total 78 (delta 18), reused 0 (delta 0)
remote: Compressing source files... done.
remote: Building source:
remote:
remote: -----> Building on the Heroku-20 stack
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: !
remote: ! ## Warning - The same version of this code has already been built: ad15f239126a3588a2ab6585b0ae52bfa25d9b7e
remote: !
remote: ! We have detected that you have triggered a build from source code with version ad15f239126a3588a2ab6585b0ae52bfa25d9b7e
remote: ! at least twice. One common cause of this behavior is attempting to deploy code from a different branch.
remote: !
remote: ! If you are developing on a branch and deploying via git you must run:
remote: !
remote: ! git push heroku <branchname>:main
remote: !
remote: ! This article goes into details on the behavior:
remote: ! https://devcenter.heroku.com/articles/duplicate-build-version
remote:
remote: Verifying deploy...
remote:
remote: ! Push rejected to django-210307.
remote:
To https://git.heroku.com/django-210307.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/django-210307.git'
我已经运行了 heroku create
,
“djangogirls210307”已在heroku上创建。
下面的输出是用heroku info --app diangogirls210307
获得的信息
=== djangogirls210307
Auto Cert Mgmt: false
Dynos:
Git URL: https://git.heroku.com/djangogirls210307.git
Owner: mailme@gmail.com
Region: us
Repo Size: 0 B
Slug Size: 0 B
Stack: heroku-20
Web URL: https://djangogirls210307.herokuapp.com/
我还将工作目录命名为“djangogirls210307”并在其中使用以下结构。
djangogirls210307/
|
|- env // by "venv", not "virtualenv""pipenv"
|-mysite // name of project
|-__init__.py
|-asgi.py
|-local_settings.py
|-urls.py
|-settings.py
|-wsgi.py
|-.gitignore
|-manage.py
|-Procfile
|-requirements.txt
|-runtime.txt
错误中显示'django-210307.git',但可能是今天练习时创建的远程仓库。
git push heroku master
命令修复了推送目标。答案 0 :(得分:0)
remote: -----> Building on the Heroku-20 stack
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
手动设置构建包:
heroku buildpacks:set heroku/python