On Sunday, December 18, 2011 9:39:28 AM UTC-8, Chris Rossi wrote: > > On Sun, Dec 18, 2011 at 7:55 AM, Ahmed <[email protected]> wrote: > > I wonder what is the best practice for my case? And if using a > > template renderer is the best solution, how is that best made? For > > example is the Chameleon text template suitable for this job? > > > That's what I would use. I'm usually able to factor my js in such a > way, though, that my js files can be served statically and only depend > a few lines of dynamic data injected into the html page in a <script> > tag.
Similarly, I create a single JSON config object in a helper function and inject it into the template; it gets passed to a main JavaScript function (defined in a separate script file), which sort-of reflects how a Pyramid app is initialized. For a while, I did some dynamic JS setup using Mako, but it was a bit messy, and I prefer the straight JSON/JS approach. -- You received this message because you are subscribed to the Google Groups "pylons-discuss" group. To view this discussion on the web visit https://groups.google.com/d/msg/pylons-discuss/-/PdjonC9UF5sJ. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/pylons-discuss?hl=en.
