https://github.com/stepanzubkov/bakery
Flask website for bakery.
https://github.com/stepanzubkov/bakery
Last synced: over 1 year ago
JSON representation
Flask website for bakery.
- Host: GitHub
- URL: https://github.com/stepanzubkov/bakery
- Owner: stepanzubkov
- License: mit
- Created: 2022-04-01T18:52:39.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2022-07-12T10:25:01.000Z (about 4 years ago)
- Last Synced: 2025-01-23T14:15:17.427Z (over 1 year ago)
- Language: Python
- Size: 12 MB
- Stars: 3
- Watchers: 2
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Bakery - website on flask
This is a site for an American bakery. You can familiarize yourself with the functionality.
## Run app
For this website i use docker and you can simply run this app in one line
```bash
docker-compose up -d --build
```
The container will run in background (option -d) and you can easy run different commands, like 'bash' or 'ls', with 'docker-compose exec'
If you want insert into db test data, you must run this command:
```bash
docker-compose exec -w /app app sh
```
Then, type:
```bash
flask db upgrade
python test_data.py
```
Blog page will show youtube videos from channel only when you spicify the access token.
You should create file 'youtube_token.txt' and place youtube access key into this file.
See https://console.cloud.google.com/ to do this.
## Migrations
For editing DB tables on python, i use migrations with flask-migrate. You can easy create your own DB's versions.
Use this command to get the cli in the container:
```bash
docker-compose exec -w /app app sh
```
And, you can upgrade db:
```bash
flask db upgrade
```
If you want to create your own migration, you must edit db models and run this command in the container:
```bash
flask db migrate -m "My migration message"
```
## Tests
For tests, you should run the app.
Then, go to the tests folder and run tests with following commands:
```bash
cd tests
pytest
```
Run single test, for example:
```bash
pytest api/test_products.py
```
## Contribution
If you want to contribute, please write me (contacts in bio)
### Good luck :)