[Twisted-web] reloading nevow templates

christian simms christian.simms at gmail.com
Wed Nov 29 14:54:38 CST 2006

On 11/29/06, glyph at divmod.com <glyph at divmod.com> wrote:
> On 01:46 pm, p.mayers at imperial.ac.uk wrote:
> >Do the nevow rend.Page and athena.LivePage co-operate with the t.p.u.reload
> >mechanism?
> No.
> >For various reasons I don't want to stop the process to reload the changes
> >I've made to disk and .py templates, but would like to be able to reload
> >them.
> Disk templates do not contain python code and therefore do not need to be
> integrated with t.p.u.rebuild.  They already load automatically based on
> modification time.
> .py files are a much more intricate problem.
> >Thoughts?
> Rebuild is a nice idea, but a lot more work would need to be done to make it
> work reliably (or rather, fail gracefully and report sane errors when it
> *can't* work reliably).  Getting this to work properly really has nothing to
> do with nevow, although nevow does exacerbate some problems with it.
> I'd recommend just manually restarting the server during development for
> now.
> _______________________________________________
> Twisted-web mailing list
> Twisted-web at twistedmatrix.com
> http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-web

I personally just use the standard Python "reload" function on my
major web modules, then when I hit ctrl-R in my browser it loads the
latest Python code and re-renders the current page using it.  The
major downside with this approach is that you must structure your
Python code in a way that works with reload.  The other potential
gotcha is that reload is really slow and you don't want it in
production code, so I always wrap mine with "if __debug__".


More information about the Twisted-web mailing list