Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/un4gt/flask-mvc
A Flask-MVC templates base on cookiecutter
https://github.com/un4gt/flask-mvc
cookiecutter cookiecutter-template flask flask-mvc flask-mvc-template
Last synced: about 19 hours ago
JSON representation
A Flask-MVC templates base on cookiecutter
- Host: GitHub
- URL: https://github.com/un4gt/flask-mvc
- Owner: un4gt
- License: mit
- Created: 2024-08-24T19:22:30.000Z (4 months ago)
- Default Branch: main
- Last Pushed: 2024-08-24T20:57:16.000Z (4 months ago)
- Last Synced: 2024-11-05T16:30:46.669Z (about 2 months ago)
- Topics: cookiecutter, cookiecutter-template, flask, flask-mvc, flask-mvc-template
- Language: Python
- Homepage:
- Size: 10.7 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Flask-MVC
[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
│ cookiecutter.json
│ LICENSE
│ README.md
│
└─{{cookiecutter.application_name}}
│ .gitignore
│ config.py
│ README.md
│ {{cookiecutter.application_name}}.py
│
├─tests
│ __init__.py
│
└─{{cookiecutter.app_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
│
├─static # static file folder
│ .gitkeep
│
└─templates
403.html # forbidden page
404.html # not found page
500.html # internal server error page
base.html # base template to extends
index.html # home page
```## 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/un4gt/Flask-MVC
```#### With [Flasky-Cli](https://github.com/un4gt/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.