[PYTHON] Where I was worried about heroku

About this article

I deployed the python file on heroku by referring to this article. Record the solution because an error occurred on the way.

Flow to deployment

  1. Heroku's Create Account
  2. Install Heroku CLI with brew
  3. $ heroku login
  4. $ heroku create <app name>
  5. List the external library in requirements.txt (Deployment procedure is written on the Deploy page of the created app)
  6. $ heroku git: clone -a <app name>
  7. $ cd <app name>
  8. $ git add .
  9. $ git commit -am "make it better"
  10. $ git push heroku master

ERROR

No default language could be detected for this app.


(venv) ~/p/post_notice_heroku (master|✔) $ git push heroku master
Counting objects: 33, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (31/31), done.
Writing objects: 100% (33/33), 6.59 KiB | 844.00 KiB/s, done.
Total 33 (delta 12), 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 <app name>.
remote: 
To https://git.heroku.com/<app name>.git
 ![remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/<app name>.git'

It is necessary to set the build pack. Select python from here. Run $ heroku buildpacks: set heroku / python


(venv) ~/p/post_notice_heroku (master|…) $ heroku buildpacks:set heroku/python
Buildpack set. Next release on <app name> will use heroku/python.
Run git push heroku master to create a new release using this buildpack.

App not compatible with buildpack: https://buildpack-registry.s3.amazonaws.com/buildpacks/heroku/python.tgz


(venv) ~/p/post_notice_heroku (master|…) $ git push heroku master
Counting objects: 33, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (31/31), done.
Writing objects: 100% (33/33), 6.59 KiB | 844.00 KiB/s, done.
Total 33 (delta 12), reused 0 (delta 0)
remote: Compressing source files... done.
remote: Building source:
remote: 
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: Verifying deploy...
remote: 
remote: !       Push rejected to <app name>.
remote: 
To https://git.heroku.com/<app name>.git
 ![remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/<app name>.git'

This was because I didn't create requirements.txt in the file I was pushing. The external library needs to be described in this txt file.

Please verify your account to install this add-on plan

venv) ~/p/post_notice_heroku (master|✔) $ heroku addons:add scheduler:standard
Creating scheduler:standard on ⬢ <app name>... !
 ▸    Please verify your account to install this add-on plan (please enter a credit card) For more information, see
 ▸    https://devcenter.heroku.com/categories/billing Verify now at https://heroku.com/verify

It ran $ heroku addons: create scheduler: standard to introduce a heroku scheduler that runs regularly on heroku Occasionally occurs. To use the heroku scheduler, you need to register your credit card.

After registering your credit card, you can set it from the console by doing $ heroku addons: create scheduler: standard again.

Couldn't find that app. This happened when I was creating and deleting some apps on Heroku.

Looking at ʻopen .git / config`,

[remote "heroku"]
	url = https://git.heroku.com/<app name>.git

Since this part was the app name that should have been deleted, it was resolved by directly rewriting it to the current app name.

Recommended Posts

Where I was worried about heroku
What I was worried about when displaying images with matplotlib
I came across a lambda expression when I was worried about functionalization
About launching an instance with an encrypted EBS volume (where I was addicted)
About the matter that was worried about sampling error
Two things I was happy about with Python 3.9
I was in trouble because I couldn't push with heroku
I searched about Pynamodb
What I was careful about when implementing Airflow with docker-compose
Where I stumbled on SQLite3
I studied about Systemd properly
What I learned about Linux