After deploying the application created by Django to heroku, the application does not appear.
After deployment, open the URL of the app
The following error occurred:
Application error
Error occurred in the application and your page could not be served. If you are the application owner, check your logs for details. You can do this from the Heroku CLI with the command
herokur logs --tail
When I checked that the log needs to be chucked
I found the following error, but I couldn't find a clear answer when I searched.
What is the possible cause of this error (at=error code=H10desc="App crashed"?
Also, I would appreciate it if you could advise me if there is a solution.
Excerpts
2020-12-11T07:28:47.775779+00:00 heroku [router]: at=error code=H10desc="App crashed" method=GET path="/"host=hogehoge.herokuapp.com request_id=ea446ace-d220-4db4-bab8-446266d866d.686d=101wn=1184.dvice=10180d1184.dfectn1184.
2020-12-11T07:28:47.909678 + 00:00 heroku [router]: at=error code=H10desc="App crashed" method=GET path="/favicon.ico" host=hogehoge.herokuapp.com request_id=c5b7a954-6d34-4a6e-87e1-2428df78a.29a.29a.snvice=101=1018.84wervice=101
2020-12-11T07:04:39.534550+00:00 heroku [router]: at=error code=H10desc="App crashed" method=GET path="/"host=hogehoge.herokuapp.com request_id=58 dbe69a-0704-44f8-aefb-ff77769a8 fwd="stovice=101.50noconnect=118.50nus=50
2020-12-11T07:04:40.143720 + 00:00 heroku [router]: at=error code=H10desc="App crashed" method=GET path="/favicon.ico" host=hogehoge.herokuapp.com request_id=be70bdb3-5501-4f94-837f-785c694ef87ef.87ef.89=101=101=1184.device=101
I think the error code you asked is either the application crashed or the startup timeout.
https://devcenter.heroku.com/articles/error-codes#h10-app-crashed
To run the app on Heroku
The above three are required.Place everything in the root of the repository.
requirements.txt
pip freeze>requirements.txt
For requirements.txt, execute the above command on the root of the repository.
Procfile
web:gunicorn myproject.wsgi
runtime.txt
python-3.9.0
Please create and write the Procfile and runtime.txt files.
Change the Procfile myproject.wsgi
to the project name.
The django development server is not suitable for the production environment, so we use gunicorn.
Before creating requirements.txt, run the following command:
pip install gunicorn
Reference Links
https://devcenter.heroku.com/ja/articles/django-app-configuration
https://devcenter.heroku.com/ja/articles/deploying-python
https://devcenter.heroku.com/ja/articles/getting-started-with-python
© 2024 OneMinuteCode. All rights reserved.