Re: Different static directories for development/production

2012-01-17 Thread Jonathan Vanasco
someone on this list, not too long ago , wanted to render their javascript/css with mako or jinja templates. so they'd be normal javascript / css files -- but in production they might have some different vars or images. an example in practice: on an earlier version of a website ( which I had

Different static directories for development/production

2012-01-16 Thread Martin Stein
Hi everyone, For the current project at work, we are looking into using require.js (http://requirejs.org/) to combine, modularize and minify our javascript. So, basically, we need to have a server-side build step before serving our static files. Our plan is as follows: - have our pre-build

Re: Different static directories for development/production

2012-01-16 Thread Marius Gedminas
On Mon, Jan 16, 2012 at 05:28:45AM -0800, Martin Stein wrote: For the current project at work, we are looking into using require.js (http://requirejs.org/) to combine, modularize and minify our javascript. So, basically, we need to have a server-side build step before serving our static files.

Re: Different static directories for development/production

2012-01-16 Thread Gael Pasgrimaud
Hi! Not really an answer... and also a bit off topic. But are you aware of Fanstatic[1] ? I've wrote a pyramid_fanstatic package to use it as a pyramid tween[2] And a blog post about how to use lesscss with all that stuff[3] May be it can feet your needs... [1]

Re: Different static directories for development/production

2012-01-16 Thread Arndt Droullier
Hi, if your application automatically finds myproject: in templates (try {request.static_url('static/js/application.js')}) you could name both directories /static and include them in different python modules. On startup register the one to be used (based on ini file settings or whatever).

Re: Different static directories for development/production

2012-01-16 Thread Martin Stein
Hi Gael, Thanks for your reply. Yes, I was aware of fanstatic and it looks very interesting. And it does provide lots of the same features: bundles, dependency tracking, development/production differentation. But, to be honest, I am not sure yet, if I like the approach of 'including' .css and

Re: Different static directories for development/production

2012-01-16 Thread Arndt Droullier
Maybe this wasn't such a good idea... Sorry. I've just reactived an older test version and it doesn't work. At least static_url() and relative paths don't work with the new pyramid version. ? However, additionally you can set the current static directory in the ini file

Re: Different static directories for development/production

2012-01-16 Thread Martin Stein
Hey Arndt, yeah, I've just tried to get your first suggestion working, but I didn't manage to. It's a pity, because I think that approach would have been very elegant! So, the API documentation for request.static_url seems to be wrong? According to the API docs, you can generate paths from

Re: Different static directories for development/production

2012-01-16 Thread Carsten Senger
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Am 16.01.2012 14:28, schrieb Martin Stein: For the current project at work, we are looking into using require.js (http://requirejs.org/) to combine, modularize and minify our javascript. So, basically, we need to have a server-side build step

Re: Different static directories for development/production

2012-01-16 Thread Chris McDonough
On Mon, 2012-01-16 at 05:28 -0800, Martin Stein wrote: Hi everyone, For the current project at work, we are looking into using require.js (http://requirejs.org/) to combine, modularize and minify our javascript. So, basically, we need to have a server-side build step before serving our

Re: Different static directories for development/production

2012-01-16 Thread Jonathan Vanasco
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

Re: Different static directories for development/production

2012-01-16 Thread Martin Stein
Chris, thanks, an approach like that was exactly what I was looking for! @Jonathan: Your suggestion sounds interesting, though I'm not sure I understand everything. Why are javascript templates (we are talking about things like Mustache or Handlebar templates, right?) a special case? They are