index.wsgi
# coding: utf-8
import sys
import os
g_basePath = os.path.dirname(__file__)
sys.path.append(g_basePath)
os.chdir(g_basePath)
from main import *
import bottle
#bottle_last.debug(True)
application = bottle.default_app()
# coding: utf8
import MySQLdb
from bottle import route
db=MySQLdb.connect("localhost","user","pasw","dbname")
@route('/')
def main():
cursor = db.cursor()
cursor.execute('SELECT * FROM data LIMIT %s', (10,) )
res = cursor.fetchall()
if res: msg = str( res )
else: msg = 'none result'
return msg