A Quart auto importer that allows your Quart apps to grow big.
Project description
Quart-Imp
What is Quart-Imp?
Quart-Imp's main purpose is to help simplify the importing of blueprints, resources, and models. It has a few extra features built in to help with securing pages and password authentication.
Note
Quart-Flask-Patch is required to use Quart-Imp.
Generate a Quart app
quart-imp init
Example
project/
└── app/
├── blueprints/
│ └── www/...
├── extensions/
│ └── __init__.py
├── resources/
│ ├── static/...
│ ├── templates/...
│ └── routes.py
└── __init__.py
# app/extensions/__init__.py
import quart_flask_patch
from flask_sqlalchemy import SQLAlchemy
from quart_imp import Imp
_ = quart_flask_patch
imp = Imp()
db = SQLAlchemy()
# app/__init__.py
from quart import Quart
from app.extensions import imp, db
def create_app():
app = Quart(__name__, static_url_path="/")
imp.init_app(app)
imp.import_app_resources(
files_to_import=["*"],
folders_to_import=["*"]
)
imp.import_blueprints("blueprints")
imp.import_models("models")
db.init_app(app)
@app.before_serving
async def create_tables():
db.create_all()
return app
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
quart_imp-0.1.1.tar.gz
(65.2 kB
view hashes)
Built Distribution
quart_imp-0.1.1-py3-none-any.whl
(76.9 kB
view hashes)
Close
Hashes for quart_imp-0.1.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | cf68d6f59a50bb311c72399c7406f5b393ff2931e3a8153d1834d65acbc82086 |
|
MD5 | 543e1f230d6c0c47f484877a3c048aca |
|
BLAKE2b-256 | d409a34537590219b5c0371a2ac6bc779190e7b3c389c0234c7b5829609543b7 |