[英]I want to deploy a Django app on Heroku, but I got error
The development environment is wsl (debian), python3.9.0, and the virtual environment is "venv".开发环境是wsl(debian),python3.9.0,虚拟环境是“venv”。
I referred here:我在这里提到:
https://tutorial-extensions.djangogirls.org/ja/heroku/ https://tutorial-extensions.djangogirls.org/ja/heroku/
It was completed before this code:它在此代码之前完成:
git push heroku master
Run git push heroku master
,运行git push heroku master
,
then I got the following error:然后我收到以下错误:
(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'
I've run heroku create
,我已经运行heroku create
,
"djangogirls210307" has been created on heroku. “djangogirls210307”已在 heroku 上创建。
The output below is the information obtained with heroku info --app diangogirls210307
下面的output是用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/
I also named the work directory "djangogirls210307" and worked with the following structure in it.我还将工作目录命名为“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
In the error,'django-210307.git' is displayed, but it is probably the remote repository created during practice today.报错中显示了'django-210307.git',但很可能是今天练习时创建的远程仓库。
git push heroku master
command.但是,我不明白为什么使用git push heroku master
命令修复了推送目标。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
Set a buildpack manually:手动设置 buildpack:
heroku buildpacks:set heroku/python
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.