Skip to content

un4gt/Flask-MVC

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Flask-MVC

Cookiecutter template to create new 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.

│  .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

Install Cookiecutter

pip install --upgrade cookiecutter

Create a new project

With cookiecutter

cookiecutter https://github.com/un4gt/Flask-MVC
Install Flasky-Cli
pip install --upgrade flasky-cli
Create new project
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.