reload templates but not code

55 views
Skip to first unread message

shahn

unread,
Mar 21, 2012, 9:01:37 PM3/21/12
to snap_fr...@googlegroups.com
Hi!

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


Thanks,
Sönke

MightyByte

unread,
Mar 21, 2012, 9:05:09 PM3/21/12
to snap_fr...@googlegroups.com

shahn

unread,
Mar 21, 2012, 9:17:56 PM3/21/12
to snap_fr...@googlegroups.com
I see. This does exactly, what we need:

while inotifywait snaplets/heist/resources/**/* ; do curl localhost:8000/admin/reload ; done

That's great, thanks.

MightyByte

unread,
Mar 21, 2012, 9:23:17 PM3/21/12
to snap_fr...@googlegroups.com
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.

shahn

unread,
Mar 21, 2012, 11:05:44 PM3/21/12
to snap_fr...@googlegroups.com
Am Donnerstag, 22. März 2012 02:23:17 UTC+1 schrieb mightybyte:
Note that we restricted this to requests coming from localhost because
otherwise there's the potential for a DOS attack.

I was wondering about that. And I hoped there was a restriction to localhost. Good to know there is, thanks.

Reply all
Reply to author
Forward
0 new messages