I am using django on the server side and obviously javascript on the client side. Now i want to use the plate template engine on the client.
What's the best way so serve django templates to the client? We taught of some ways doing that.
- Create a view that serves the raw templates.
- probably not the best method
- Copy the needed templates to the static folder.
- this could be done with a custom static files finder
- the broser is able to cache the templates
- Provide the templates using a template tag which puts the raw template into a javascript variables.
- templates received this way can not be cached seperatly
is a django app out there that makes this easyer?
The reason i need the templates on the client is, that i want to use the same clients on the server and the client side. When the page is first loaded, the full template is rendered on the server, when navigating trough the application only the needed data gets loaded and the page change is done using push state.