https://github.com/eocode/test_flask
Prebuild for Flask cookiecutter
https://github.com/eocode/test_flask
flask pytest sqlalchemy
Last synced: about 1 month ago
JSON representation
Prebuild for Flask cookiecutter
- Host: GitHub
- URL: https://github.com/eocode/test_flask
- Owner: eocode
- License: mit
- Created: 2020-09-23T04:48:32.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2020-09-23T05:48:44.000Z (over 5 years ago)
- Last Synced: 2025-03-31T07:34:07.134Z (about 1 year ago)
- Topics: flask, pytest, sqlalchemy
- Language: Python
- Homepage:
- Size: 12.7 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
- Authors: AUTHORS.md
Awesome Lists containing this project
README
## Demo
Your demo project
## How to clone
You can clone this repository
git clone https://github.com/eocode/App
## File structure
* **app** (Flask configurations project)
* **init** (Create and initialize app)
* **config** (All settings environments)
* **connection** (Settings for SQLAlchemy)
* **envs** (Injectable envs in app)
* **commands** (Tools for switch environments and other quick utilities)
* **img** (Project images for documentation)
* **requirements** (Dependencies files for app)
* **test**
* **migrations** (Migrations files, not public, disabled by gitignore)
* **labs** (Labs for create quick scripts for analize problem, you can disabled by gitignore)
* **modules** Your project modules
* **example** (Main blueprint Flask module)
## Dependencies
* Flask
* python-dotenv
* Flask-sqlalchemy
* Psycopg2
* Pytest
* Flask-migrate
## Environment configuration
Edit envs/.env.* and add your configuration
Then execute:
```sh
python app/commands/environment.py development
```
Available params:
* production
* testing
* development
## Use on local
To install this project just type
Create virtual enviroment:
$ python -m venv env
Active your enviroment
Install dependencies
$ pip install -r requirements.txt
Run the project
$ flask run
## Dockerized app
Start app
```bash
docker compose up -d
```
Stop app
```bash
docker compose down
```
Rebuild app
```bash
docker-compose up -d --build
```
Access to command line interface
```bash
docker exec -it flask-app bash
```
## Run migrations
By default migrations foldar has been add to .gitignore
Open Terminal
```bash
docker exec -it flask-app bash
```
Init database migrations
```bash
flask db init
```
Generate migrations
```bash
flask db migrate
```
Run migrations
```bash
flask db upgrade
```
Show more commands
```bash
flask db
```
## Run tests
On Docker
```sh
docker-compose exec queens-app pytest
```
or only
pytest
### Ejecute coverage report
```sh
coverage run -m pytest
coverage report
coverage html
```
## Preview
Your image project previews
## How to contribute
* Review our code of conduct
# License
View in https://github.com/eocode/App/blob/master/LICENSE