Skip to content

robputt/quart-starter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Quart-Starter

A good starting point with Quart with Alembic and SQLAlchemy.

Getting started

Clone the repo, open up terminal and run:

make init

This will create a python3 virtual environment and install all of the dependencies. Also it will create a .env file for you with empty export DATABASE_URL which needs to get filled to perform migrations.

Caveats

make init assumes you have python3 installed and pip3 in your $PATH.

You must import ALL of the new models you create into the app/models/__init__.py file underneath the Base = declarative_base() declaration. This will ensure that your models will be picked up automatically when running make revision.

DATABASE_URL is the environment variable being used to run the migrations. You will have to create your own database and update the export DATABASE_URL="database url here" in the .env file. using something like autoenv makes exporting settings easy. If you have a different or preferred way of doing this you will have to update the /alembic/env.py and the app/database.py file to reflect your preferred way.

Commands

make run - Runs the Quart server

make revision - Checks all of the Base.metadata and generates a new migration script under /alembic/versions

make upgrade - Runs the revision head and upgrades all database schema.

make downgrade - Drops all of the revision heads tables.

About

A good starting point / skeleton project for using Quart.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published