collector/database.py

13 lines
257 B
Python
Raw Normal View History

2020-04-14 22:49:22 +00:00
from peewee import DatabaseProxy, Model
from playhouse.db_url import connect
import config
DB = DatabaseProxy()
class BaseModel(Model):
class Meta:
database = DB
def initialize_db():
db = connect(config.DATABASE_URL)
DB.initialize(db)