Re: Compile/generate JavaScript from Django Templates?

2012-08-07 Thread Melvyn Sopacua
On 7-8-2012 10:52, Alec Taylor wrote:
> To completely decouple the client-side, would it be possible to
> generate JavaScript from the server-side Django Template?

The template documentation explicitly tells you it can generate *any*
text-based format. [1]
A few threads ago I gave an example and pointed to
contrib/gis/templates/gis/admin/openlayers.js.

[1] https://docs.djangoproject.com/en/1.4/topics/templates/#templates
-- 
Melvyn Sopacua

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



Compile/generate JavaScript from Django Templates?

2012-08-07 Thread Alec Taylor
To completely decouple the client-side, would it be possible to
generate JavaScript from the server-side Django Template?

E.g.: using PyJamas

If not, I will use tastypie or piston to expose a RESTful JSON API
which I will consume with a JavaScript framework on the client-side
(AngularJS).

Would simplify things a lot and prevent double typing thought if it is
possible to compile/generate JavaScript from Django Templates.

Thanks for all information,

Alec Taylor

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