blob: cca5c0e33e08a600d7a49a6a54a182c034dade8c (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
|
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():
"""
Rendered for HTTP 404 errors
"""
return web.notfound(render.error_404())
def internalerror():
"""
Rendered for HTTP 500 errors
"""
return web.internalerror(render.error_500())
|