-
Notifications
You must be signed in to change notification settings - Fork 102
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for Django-unicorn? #299
Comments
what does django unicorn do? |
I’d like to use it to replace my mishmash of AJAX calls… I’ve located the template tag file, but it’s not behaving the way I would expect… The “unicorn” function is requiring parameters to be passed in. The author states:
While helpful, to me it isn't, since I'm not sure where to investigate next? I can't figure out where the actual javascript is being added to the template, and so forth. I'm really open to suggestions here, I've made some interesting (but mostly unrelated) discoveries in researching this. Including that I might be seriously unoptimized in my ajax routine... but that doesn't help here... |
If I had infinite time I'd build out a |
Folks,
is there someway to add compatibility with Django unicorn? Out of the box it's not working, and the closest I can come up with is an environment patch:
`
from django.templatetags.static import static
from django.urls import reverse
from django_icons.templatetags.icons import icon_tag
from jinja2 import Environment
from django_unicorn.templatetags.unicorn import unicorn_scripts, unicorn
def environment(**options):
env = Environment(**options)
env.globals.update({
'static': static,
'url': reverse,
'icon':icon_tag,
'unicorn':unicorn,
'unicorn_scripts':unicorn_scripts,
})
return env
`
But I'm having issues with unicorn requiring parameters to be passed? I'm talking with the Django-Unicorn folks, but I'm surprised this hasn't come up before... I suspect that since unicorn is suppose to be loaded that it's causing issues? But that's a guess...
The text was updated successfully, but these errors were encountered: