committed a few changes for moving to production
[yourule] / yourule.py
index 90102172ec531ff76aa1f97427b76f2e1f3c7434..c5ffdb7eeed914f187daf138d4cb31eee49c6dc4 100755 (executable)
@@ -7,14 +7,16 @@ from storm.locals import *
 from svgruler import SVGRuler
 
 # the url map for the application
-urls = ( '/', 'index',
+urls = ( '/?', 'index',
          '/ruler_([0-9\.]+)px_([0-9\.]+)([A-Za-z]+).(svg|png|jpg)', 'ruler_img',
          '/show/(.*(svg|png|jpg))', 'show_ruler',
          '/gallery(.*)', 'gallery',
          '/delete/(\d+)', 'delete',
          '/undelete/(\d+)', 'undelete')
 
-database = create_database("sqlite:yourule.db")
+database = create_database("sqlite:%s/db/yourule.db" %
+                           os.path.dirname(__file__))
+
 store = Store(database)
 
 class Ruler(object):
@@ -132,7 +134,7 @@ class gallery:
     def POST(self, ruler_url):
         input = web.input()
 
-        errormsg = valid_input(input)
+        errormsg = validate_input(input)
         if not input.model:
             errormsg = 'Please fill out all fields.'
 
@@ -216,5 +218,5 @@ web.webapi.internalerror = web.debugerror
 if __name__ == "__main__":
     web.run(urls, globals(), web.reloader)
 
-application = web.wsgifunc(web.webpyfunc(urls, globals()))
+#application = web.wsgifunc(web.webpyfunc(urls, globals()))
 

Benjamin Mako Hill || Want to submit a patch?