Open atogle opened 10 years ago
how ?
@hannicolas This could be done if the user has node installed. Something like:
servercompile
flag in the template taghandlebars
command isn't available on the server)The whole caching part may not even be necessary (you could just depend on Django's built-in caching infrastructure). It'd be great to get this into the app (pull requests appreciated)!
Hello, I 'm trying to load a template that uses a custom context preprocessor server-side. Which method do you suggest in order to add support for this?
I 've checked I18nPreprocessor and it seems like a lot of work(makes sense as they 're translations) The one I 'm trying to add is allauth's socialaccount preprocessor that goes like:
from . import providers
def socialaccount(request):
ctx = { 'providers': providers.registry.get_list() }
return dict(socialaccount=ctx)
in order to add the following template
{% load socialaccount %}
{% providers_media_js %}
@mitsest The most important function in the I18nPreprocessor
is the process
function. Any class you create with a function that matches this signature can be used as a preprocessor. See http://django-jstemplate.readthedocs.org/en/latest/#custom-preprocessors for more info. If you have further questions, please start a new issue. Thanks!
Thanks for the fast reply. Will do!