https://github.com/un4gt/flask-api
cookiecutter template for flask
https://github.com/un4gt/flask-api
Last synced: 3 months ago
JSON representation
cookiecutter template for flask
- Host: GitHub
- URL: https://github.com/un4gt/flask-api
- Owner: un4gt
- License: mit
- Created: 2024-04-06T14:16:37.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2024-08-24T17:11:10.000Z (10 months ago)
- Last Synced: 2025-02-15T06:23:36.393Z (4 months ago)
- Language: Python
- Size: 8.79 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Flask-API
[Cookiecutter](https://github.com/cookiecutter/cookiecutter.git) template to create new [flask](https://github.com/pallets/flask) application to build a Web API.
## Layout
Project Layout from [miguelgrinberg/flasky: Companion code to my O'Reilly book "Flask Web Development", second edition.](https://github.com/miguelgrinberg/flasky)
```text
│ .gitignore
│ config.py
│ README.md
│ {{cookiecutter.application_name}}.py
│
├─tests
└─{{cookiecutter.application_name}}
│ exceptions.py # your custom exceptions
│ __init__.py # create_app function here
│
├─main # your main blueprint
│ errors.py # web errors like 404, 403
│ views.py # just have index route
│ __init__.py
│
└─models # database models here
__init__.py
```## How to use
### With [Cookiecutter](https://github.com/cookiecutter/cookiecutter.git)
#### Install Cookiecutter
```bash
pip install --upgrade cookiecutter
```#### Create a new project
#### With `cookiecutter`
```bash
cookiecutter https://github.com/jennier0107/Flask-API
```#### With [Flasky-Cli](https://github.com/jennier0107/flasky-cli)
##### Install Flasky-Cli
```bash
pip install --upgrade flasky-cli
```##### Create new project
```bash
flasky-cli create
```and choice `Flask-API` template.
## Initialize project and run
You can use tools like pdm, pipenv, poetry or rye to init and run your project.