aboutsummaryrefslogtreecommitdiff
blob: 98326ae9094381f7cf669a8374421dc193e84493 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
import os
import sys
import web
from dbconfig import DBConfig

rootdir = os.path.abspath(os.path.dirname(__file__)) + '/'

dbconfig = DBConfig(rootdir + 'db.cfg').get_config()
db = web.database(
        dbn='mysql',
        db=dbconfig['DB'],
        user=dbconfig['USER'],
        pw=dbconfig['PASS']
        )

render = web.template.render(rootdir + 'templates/', base='layout')

def notfound():
    return web.notfound(render.error_404())

def internalerror():
    return web.internalerror(render.error_500())