Skip to content

Instantly share code, notes, and snippets.

View copocaneta's full-sized avatar

Thiago Bernardi copocaneta

View GitHub Profile

Semantic Commit Messages

See how a minor change to your commit message style can make you a better programmer.

Format: <type>(<scope>): <subject>

<scope> is optional

Example

@copocaneta
copocaneta / flask-sqlite.py
Created June 2, 2021 08:35 — forked from asyd/flask-sqlite.py
Enforce FK constraint for SQLite with when using flask-sqlalchemy
from flask import Flask
from flask_sqlalchemy import SQLAlchemy
def create_app(config: str=None):
app = Flask(__name__, instance_relative_config=True)
if config is None:
app.config.from_pyfile('dev.py')
else:
logger.debug('Using %s as configuration', config)
app.config.from_pyfile(config)