-
Windows:
- Git, Python 3 + pip3, PostrgreSQL, Heroku CLI
-
Linux (Debian/Ubuntu/PopOS):
sudo apt install -y git python3 python3-pip postresql libpq-dev snapsudo snap install --classic heroku
-
heroku login -
Clone the repository,
cd e-knihovna -
Run the setup:
- Windows:
heroku local setup -f Procfile.windowsorpip install --user -r requirements.txt - UNIX-like:
heroku local setuporpip3 install -r requirements.txt
- Windows:
- First step when not already ran:
heroku local collectstatic - Run the server:
- Windows:
heroku local web -f Procfile.windowsorpython manage.py runserver 0:5000 - UNIX-like:
heroku local weborpython3 manage.py runserver 0:5000
- Windows:
- Open browser at:
localhost:5000
Use VS Code Git GUI (RECOMMENDED), etc. or manually:
git add .git commit -m "Message"git push
Site is automatically deployed when pushed to Github repository if everything is OK.
Test the site before pushing to Github!
Both local project and deployed web is running on the same online database. Every migration, even local, will make changes to the DB.
When made changes to models.py files, you have to run:
$ heroku run python>>>from flasklib import db>>>db.create_all()>>>exit()
which will update (create/delete/...) corresponding DB tables.