I've done stuff like this before - but under mod_perl, not python - I
think the same trick would work though...

1. The javascript "source" files were held out of the website/
application root - just for security and safety.  they're held in
something called "assets/javascript/-source"
2. On application startup :
   1. If any pre-processing needs to be done, the items are processed
and saved into "assets/javascript/%s" % environment
   2. A symlink is created from app/appname/-envinronment to app/
static/js

You could even do it so for "dev" it always shows the non-minfied, but
the production/staging it always does the symlink; or never do it if a
"/javascript/environment" folder exists either.

If you needed to treat the javascript files as templates too, this
could handle that too ( i forget who was trying to do that a few weeks
ago, i don't know why I didn't recall this method then ).

There's a slight hit on application startup, but your templates remain
oblivious meaning writing and reading code is way easier.

-- 
You received this message because you are subscribed to the Google Groups 
"pylons-discuss" group.
To post to this group, send email to pylons-discuss@googlegroups.com.
To unsubscribe from this group, send email to 
pylons-discuss+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/pylons-discuss?hl=en.

Reply via email to