Commits

Andriy Kornatskyy  committed b4fa175

Use uwsgi_autoreload in demo template.

  • Participants
  • Parent commits f2f037a

Comments (0)

Files changed (3)

File demos/template/development.ini

 post-buffering = 1024
 limit-post = 1024
 idle = 300
-#python-auto-reload = 2
-#lazy = True
+python-auto-reload = 5
+lazy = True
 static-map = /static=content/static
 static-map = /favicon.ico=content/static/img/favicon.ico

File demos/template/setup.py

             'jinja2>=2.6'
         ],
         'wheezy.template': [
-            'wheezy.template>=0.1.34'
+            'wheezy.template>=0.1.47'
         ]
     },
 

File demos/template/src/config.py

     from wheezy.template.engine import Engine
     from wheezy.template.ext.core import CoreExtension
     from wheezy.template.loader import FileLoader
+    from wheezy.template.loader import uwsgi_autoreload
     from wheezy.web.templates import WheezyTemplate
     from public import __version__
     searchpath = ['content/templates-wheezy']
     engine = Engine(
-            loader=FileLoader(searchpath),
+            loader=uwsgi_autoreload(
+                FileLoader(searchpath),
+                signum=10,
+                enabled=config.getint('uwsgi', 'python-auto-reload') > 0
+            ),
             extensions=[
                 CoreExtension,
                 WidgetExtension,
         'h': html_escape,
         '__version__': __version__
     })
-    engine.preload()
     render_template = WheezyTemplate(engine)
 
 # BaseHandler