This repository has been archived on 2026-05-18. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
mercy/mercy/MercyApplication.py

23 lines
439 B
Python

import flask
import mercy.config
from flask.ext.sqlalchemy import SQLAlchemy
class MercyApplication(flask.Flask):
pass
app = None
db = None
def get_db():
global db
if not db:
db = SQLAlchemy(get_app())
return db
def get_app():
global app
if not app:
app = MercyApplication("mercy")
app.config['SQLALCHEMY_DATABASE_URI'] = mercy.config.SQLALCHEMY_URI
return app