You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
stacosys/app/core/database.py

17 lines
307 B
Python

#!/usr/bin/python
# -*- coding: UTF-8 -*-
from conf import config
from playhouse.db_url import connect
def get_db():
return connect(config.get(config.DB_URL))
def setup():
from model.site import Site
from model.comment import Comment
get_db().create_tables([Site, Comment], safe=True)