Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ricardochaves/flask_template
A Flask API base template
https://github.com/ricardochaves/flask_template
flask python3
Last synced: about 2 months ago
JSON representation
A Flask API base template
- Host: GitHub
- URL: https://github.com/ricardochaves/flask_template
- Owner: ricardochaves
- License: mit
- Created: 2018-11-25T19:36:27.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2023-05-01T20:56:51.000Z (almost 2 years ago)
- Last Synced: 2024-11-08T22:35:13.282Z (3 months ago)
- Topics: flask, python3
- Language: Python
- Size: 18.6 KB
- Stars: 2
- Watchers: 0
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# flask_template
[](https://travis-ci.org/ricardochaves/flask_template) [](https://coveralls.io/github/ricardochaves/flask_template?branch=master) [](https://github.com/ambv/black) [](https://codeclimate.com/github/ricardochaves/flask_template/maintainability) [](https://pyup.io/repos/github/ricardochaves/flask_template/) [](https://pyup.io/repos/github/ricardochaves/flask_template/) [](https://www.codacy.com/app/ricardochaves/flask_template?utm_source=github.com&utm_medium=referral&utm_content=ricardochaves/flask_template&utm_campaign=Badge_Grade)
[](https://github.com/ricardochaves/flask_template/blob/master/LICENSE)---
A Flask API base template
## Env file
Create a `.env` fila on project root, see [`.example.env`](https://github.com/ricardochaves/flask_template/blob/master/.exemple.env):
```INI
# FLASK
FLASK_APP=app.py
PORT=5005
DEBUG=True
LOGGIN_LEVEL=DEBUG# Docker
PYTHONUNBUFFERED=1
```## Lint
The project already has some lints set up
### Black
The project use [black](https://github.com/ambv/black/) and has a pre commit to ensure the application whenever a commit happens. The configuration can be find in [`.pre-commit-config.yaml`](https://github.com/ricardochaves/flask_template/blob/master/.pre-commit-config.yaml). More information [here](https://github.com/ambv/black/#version-control-integration).
The black configuration can be find in [`pyproject.toml`](https://github.com/ricardochaves/flask_template/blob/master/pyproject.toml)
### Pylint
The configuration for Pylint can be found in [`pylintrc`](https://github.com/ricardochaves/flask_template/blob/master/.pylintrc).
### Pep8 and Flake8
The configuration can be found in [`setup.cfg`](https://github.com/ricardochaves/flask_template/blob/master/setup.cfg)
## Test
To run the tests just run `tox`.
Or run with docker `docker-compose run --rm web_test`
The tox configuration can be found in [`tox.ini`](https://github.com/ricardochaves/flask_template/blob/master/tox.ini)
## VsCode
If you use [VSCode](https://code.visualstudio.com/), this is a sugestion to `settings.json`
```json
{
"python.pythonPath": ".venv/bin/python",
"files.exclude": {
"**/.git": true,
"**/__pycache__": true,
"**/*.pyc": true
},
"editor.formatOnSave": true,
"python.formatting.provider": "black",
"python.formatting.autopep8Args": ["--max-line-length=120"],
"python.formatting.blackArgs": ["--line-length=120"],
"python.linting.flake8Enabled": true,
"python.linting.pylintArgs": ["--load-plugins pylint_flask"],
"python.sortImports.args": ["-sl", "-l 120"],
"editor.codeActionsOnSave": {
"source.organizeImports": true
}
}
```## Routes
[Variable Rules](http://flask.pocoo.org/docs/1.0/quickstart/#variable-rules)