|reload templates but not code||shahn||3/21/12 6:01 PM|
With -fdevelopment you get a snap application that watches both the templates and the code for changes and reloads accordingly. Is there a way to get an application that would only reload the templates in case of changes and not the code?
Our use case is this: The person doing templates has a directory containing a snaplet subdirectory and all the needed templates. The snap application is started in this directory. If he changes the templates the application should reload the templates. But we don't need code recompilation. In fact, snap's attempts at code reloading cause trouble, i.e.:
can't find a package database at dist/package.conf.inplace
|Re: [snap] reload templates but not code||mightybyte||3/21/12 6:05 PM|
|Re: [snap] reload templates but not code||shahn||3/21/12 6:17 PM|
I see. This does exactly, what we need:
while inotifywait snaplets/heist/resources/**/* ; do curl localhost:8000/admin/reload ; done
That's great, thanks.
|Re: [snap] reload templates but not code||mightybyte||3/21/12 6:23 PM|
Note that we restricted this to requests coming from localhost because
otherwise there's the potential for a DOS attack. If you want it
available from outside the site, you could create your own route for
it and control access with auth.
|Re: [snap] reload templates but not code||shahn||3/21/12 8:05 PM|
Am Donnerstag, 22. März 2012 02:23:17 UTC+1 schrieb mightybyte:Note that we restricted this to requests coming from localhost because
I was wondering about that. And I hoped there was a restriction to localhost. Good to know there is, thanks.