I'm new to bottle and I'd like to create a small web app using bottle.
The idea is to create 2 files (index.py and lib.py) to match URL such as
host:8080/ and host:8080/lib
I found a way to do it, calling mount from index.py such as :
fro, m lib import lib
index = bottle.Bottle()
This works well.
But Ilike to access postgresql db, so I use bottle_pgsql plugin to do it.
So I install the plugin into lib.py such as:
lib = bottle.Bottle()
libcfg configdict.ConfigDict = ('demult.ini')
lib.config = libcfg
lib.TEMPLATE_PATH = [libcfg.get ('tmpl') ['library']]
pgsql = bottle_pgsql.Plugin ('dbname =' + libcfg.get ('db') ['dbnm'] +
'User =' + libcfg.get ('db') ['user'] +
'Password =' + libcfg.get ('db') ['pass'] +
'Host =' + libcfg.get ('db') ['host'] +
'Port =' + libcfg.get ('db') ['port'])
then when I do
I get a 500 internal server error without any output from the dev server
So 'm confused and what should I do? Should I remove 'apply' from the route
decorator and let the install call in place
or should I call only 'apply' in route decorator remove install call?
I've tried both and the result is the same.
However, when I call host:8080/ it work perfecly and display my index html
page where as host:8080/lib return 500 internal error
I hope my question is clear enough?
Thanks in advance.