Heroku: Difference between revisions

From Wiki RB4
Line 23: Line 23:
  PS C:\Temp\python-getting-started> .\venv\Scripts\activate
  PS C:\Temp\python-getting-started> .\venv\Scripts\activate
  (venv) PS C:\Temp\python-getting-started> pip install -r .\requirements.txt
  (venv) PS C:\Temp\python-getting-started> pip install -r .\requirements.txt
* run it locally
(venv) PS C:\Temp\python-getting-started> python manage.py collectstatic
(venv) PS C:\Temp\python-getting-started> heroku local -f .\Procfile.windows
* open it http://localhost:5000/


==Resources==
==Resources==
* [https://devcenter.heroku.com/articles/getting-started-with-python Tutorial]
* [https://devcenter.heroku.com/articles/getting-started-with-python Tutorial]

Revision as of 17:53, 16 February 2022

Installation

Concepts

  • all Heroku applications run in a collection of lightweight Linux containers called Dynos. To find out the dynos:
heroku ps

Example

PS C:\Temp\python-getting-started> heroku login
  • clone example
  • create app and push code
  • start the app
PS C:\Temp\python-getting-started> heroku ps:scale web=1
Scaling dynos... done, now running web at 1:Free
PS C:\Temp\python-getting-started> heroku open
// opens https://arcane-peak-78109.herokuapp.com/
  • open the dashboard
  • stop it or scale it down to 0
heroku ps:scale web=0
  • prepare for running locally
PS C:\Temp\python-getting-started> python -m venv venv
PS C:\Temp\python-getting-started> .\venv\Scripts\activate
(venv) PS C:\Temp\python-getting-started> pip install -r .\requirements.txt
  • run it locally
(venv) PS C:\Temp\python-getting-started> python manage.py collectstatic
(venv) PS C:\Temp\python-getting-started> heroku local -f .\Procfile.windows

Resources