Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/comhendrik/pythonherokuservertutorial
Tutorial to set up a heroku webpage
https://github.com/comhendrik/pythonherokuservertutorial
flask heroku python
Last synced: 7 days ago
JSON representation
Tutorial to set up a heroku webpage
- Host: GitHub
- URL: https://github.com/comhendrik/pythonherokuservertutorial
- Owner: comhendrik
- Created: 2022-10-05T17:56:04.000Z (over 2 years ago)
- Default Branch: master
- Last Pushed: 2022-10-05T18:06:05.000Z (over 2 years ago)
- Last Synced: 2024-11-20T18:12:04.523Z (2 months ago)
- Topics: flask, heroku, python
- Homepage:
- Size: 4.88 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
First, make sure you have the Heroku CLI installed in addition to git.
Create a virtual environment in the directory with:```
python3 -m venv
```and activate it with
```
. /bin/activate
```You will use a gunicorn production server and the Flask Framework to build your Python Server. So you need to install all Frameworks with:
```
pip install -r requirements.txt
```or install them seperately with:
```
pip install
```You need a Procfile located in the root directory. I already added it to the root directory so you don't need to create it on your own. It contains everything you need to run a gunicorn server on heroku.
Now run:
```
git init
```
The git init command isn't necassary because you already have a repository after downloading but you need to include when you start from scratch
```
git add .
git commit -m ""
```
You are ready for the preperations on your local directory.
We are starting with the deployment on heroku:
Run and follow the instructions:
```
heroku login
```
You need to create a app with:
```
heroku create
```
(if you don't provide appname, heroku creates a random name.)
To give heroku acces to your git repo run:
```
heroku git:remote
```
Now is the time to push your repo to heroku with(heroku will automatically build the application and you can visit it under https://appname.herokuapp.com/test):
```
git push heroku master
```