# Path: init_db.py



import sys
import os.path
import tornado.web
import tornado.ioloop
import tornado.httpserver
import urls
        import qiniu.conf
from init_db import db, async_db
from settings import *
from tornado.options import define, options
if major < 3:
    reload(sys)
    sys.setdefaultencoding('utf-8')

define('port', default=8888, help='run on the given port', type=int)

class Application(tornado.web.Application):
    def __init__(self):


        #Use Qiniu to store avatars
        qiniu.conf.ACCESS_KEY = qiniu_access_key
        qiniu.conf.SECRET_KEY = qiniu_secret_key

        settings = dict(
            static_path = os.path.join(os.path.dirname(__file__), "static"),
            template_path = os.path.join(os.path.dirname(__file__), "templates"),
            autoescape = None,
            site_name = site_name,
            site_url = site_url,
            google_analytics = google_analytics.lstrip(),
            role = {1: 'Member',2: 'Admin',3: 'Lord'},
            cookie_secret = cookie_secret,
            xsrf_cookies = True,
            login_url = "/account/signin",
            debug = Debug,
        )
        tornado.web.Application.__init__(self, urls.handlers, **settings)

        self.db = db

# Path: init_db.py



# Path: main.py
import sys
import os.path
import tornado.web
import tornado.ioloop
import tornado.httpserver
import urls
        import qiniu.conf
from init_db import db, async_db
from settings import *
from tornado.options import define, options

if major < 3:
    reload(sys)
    sys.setdefaultencoding('utf-8')

define('port', default=8888, help='run on the given port', type=int)

class Application(tornado.web.Application):
    def __init__(self):


        #Use Qiniu to store avatars
        qiniu.conf.ACCESS_KEY = qiniu_access_key
        qiniu.conf.SECRET_KEY = qiniu_secret_key

        settings = dict(
            static_path = os.path.join(os.path.dirname(__file__), "static"),
            template_path = os.path.join(os.path.dirname(__file__), "templates"),
            autoescape = None,
            site_name = site_name,
            site_url = site_url,
            google_analytics = google_analytics.lstrip(),
            role = {1: 'Member',2: 'Admin',3: 'Lord'},
            cookie_secret = cookie_secret,
            xsrf_cookies = True,
            login_url = "/account/signin",
            debug = Debug,
        )
        tornado.web.Application.__init__(self, urls.handlers, **settings)

        self.db = db

        self.async_db = async_db