capsul-flask/capsulflask/__init__.py

24 lines
564 B
Python

from flask import Flask
import os
def create_app():
app = Flask(__name__)
app.config.from_mapping(
SECRET_KEY=os.environ.get("SECRET_KEY", default="dev"),
DATABASE_URL=os.environ.get("DATABASE_URL", default="sql://postgres:dev@localhost:5432/postgres"),
DATABASE_SCHEMA=os.environ.get("DATABASE_SCHEMA", default="public"),
)
from capsulflask import db
db.init_app(app)
# from capsulflask import auth, blog
# app.register_blueprint(auth.bp)
# app.register_blueprint(blog.bp)
app.add_url_rule("/", endpoint="index")
return app