import web
import sys, os, re
from storm.locals import *
+
+# recalculate the path based on the location of the file
+sys.path.append(os.path.dirname(__file__))
from svgruler import SVGRuler
from jinja import Environment, FileSystemLoader
jinja_env = Environment('<%', '%>', '<%=', '%>', '<%#', '%>',
- loader=FileSystemLoader('templates/'))
+ loader=FileSystemLoader(os.path.dirname(__file__) + "/templates/"))
def render(filename, vars):
web.header("Content-Type","text/html; charset=utf-8")
tmpl = jinja_env.get_template(filename + '.tmpl')
print tmpl.render(vars)
- web.debug(web.ctx)
+ print web.ctx
# the url map for the application
urls = ( '/?', 'index',
if __name__ == "__main__":
web.run(urls, globals(), web.reloader)
-#application = web.wsgifunc(web.webpyfunc(urls, globals()))
+application = web.wsgifunc(web.webpyfunc(urls, globals()))