Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

flask-app-template

Flask app template with migrations and autoloader. Based on Flask-SQLAlchemy and Flask-Migrate.

How to use

  1. Clone the repo

  2. Install requirement

    pip install -r requirement.txt
  3. Init migrations dir

    flask db init
  4. Generate first migration for User class (app/models/user.py) and apply it

    flask db migrate -m "Add User"
    flask db upgrade
  5. Create new class app/models/product.py

    from . import db
    
    class Product(db.Model):
        id = db.Column(db.Integer, primary_key=True)
        name = db.Column(db.String(128))

    Then run migrate, upgrade and commit changes.

About

Flask app template with migrations and autoloader. One file - one model.

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages