Herokuでデプロイする際にエラーになります。
初めて質問させていただきます。
宜しくお願いし致します。
Djangoで作成したアプリケーションをHerokuにデプロイする際にエラーが出ます。
アップデートをする前ではデプロイできたにもかかわらず、22stackの更新をおこなってからデプロイをする事ができなくなりました。
初めて作るアプリケーションなので、最後までデプロイしたいと思っています。
環境
Windows11
Python3.10.8
Vscode
試したこと
- buildpacksの更新
- 推奨環境への変更(Python3.9.13→Python3.10.8)※runtime.txtの更新
- requirements.txt の確認
- heroku ecoDyno・PosgreSQLの有料プランへの加入
該当のソースコード
Enumerating objects: 173, done. Counting objects: 100% (173/173), done. Delta compression using up to 8 threads Compressing objects: 100% (162/162), done. Writing objects: 100% (173/173), 32.95 KiB | 992.00 KiB/s, done. Total 173 (delta 62), reused 0 (delta 0), pack-reused 0 remote: Compressing source files... done. remote: Building source: remote: remote: -----> Building on the Heroku-22 stack remote: -----> Using buildpack: heroku/python remote: -----> App not compatible with buildpack: https://buildpack-registry.s3.amazonaws.com/buildpacks/heroku/python.tgz remote: More info: https://devcenter.heroku.com/articles/buildpacks#detection-failure remote: remote: ! Push failed remote: ! remote: ! ## Warning - The same version of this code has already been built: 3e05dc58063cf8b3efba4fe0c7abe218615d6516 remote: ! remote: ! We have detected that you have triggered a build from source code with version 3e05dc58063cf8b3efba4fe0c7abe218615d6516 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 testapp1114. remote: To https://git.heroku.com/testapp1114.git ! [remote rejected] main -> main (pre-receive hook declined) error: failed to push some refs to 'https://git.heroku.com/testapp1114.git'
ファイル構造
C:.
│ .gitattributes
│
└─myproject
│ .gitignore
│ db.sqlite3
│ manage.py
│ Procfile
│ requirements.txt
│ runtime.txt
│
├─myapp
│ │ admin.py
│ │ apps.py
│ │ form.py
│ │ models.py
│ │ tests.py
│ │ urls.py
│ │ views.py
│ │ init.py
│ │
│ ├─migrations
│ │ │ 0001_initial.py
│ │ │ init.py
│ │ │
│ │ └─__pycache__
│ │ 0001_initial.cpython-39.pyc
│ │ init.cpython-39.pyc
│ │
│ ├─templates
│ │ └─myapp
│ │ base.html
│ │ index.html
│ │ post_confirm_delete.html
│ │ post_detail.html
│ │ post_form.html
│ │
│ └─__pycache__
│ admin.cpython-39.pyc
│ apps.cpython-39.pyc
│ form.cpython-39.pyc
│ models.cpython-39.pyc
│ urls.cpython-39.pyc
│ views.cpython-39.pyc
│ init.cpython-39.pyc
│
├─myproject
│ │ asgi.py
│ │ local_settings.py
│ │ settings.py
│ │ urls.py
│ │ wsgi.py
│ │ init.py
│ │
│ └─__pycache__
│ settings.cpython-39.pyc
│ urls.cpython-39.pyc
│ wsgi.cpython-39.pyc
│ init.cpython-39.pyc
│
├─static
│ style.css
│
└─staticfiles
参考にしたURL
- https://devcenter.heroku.com/articles/heroku-22-stack
- https://elements.heroku.com/buildpacks/heroku/heroku-buildpack-python
requirements.txt,runtime.txtの中身
txt
1asgiref==3.5.2 2certifi==2022.9.14 3dj-database-url==1.0.0 4django==4.1 5gunicorn==20.1.0 6sqlparse==0.4.1 7whitenoise==6.2.0 8wincertstore==0.2 9django-on-heroku==1.1.2
txt
1python-3.10.8
あなたの回答
tips
プレビュー