Domanda

I try to use django-filebrowser-no-grappelli with Django 1.5. The prodlem is: In Django 1.5 the template tags library adminmedia, which only contained the deprecated template tag {% admin_media_prefix %}, was removed. Django-filebrowser-no-grappelli use adminmedia in templates:

{% adminmedia %}
<link rel="stylesheet" type="text/css" href="{% custom_admin_media_prefix %}css/forms.css" />

How can I fix it? Thx!

È stato utile?

Soluzione

Ok,

settings.py:

TEMPLATE_CONTEXT_PROCESSORS = (
    .....
    'django.core.context_processors.static',
)

Then change all {% adminmedia %} on {% static %}, {% custom_admin_media_prefix %} on {{ STATIC_URL }}.

Add quotes to all {% url 'someting' %} (new syntax in 1.5). Maybe it's not absolutely correct, but it's working.

But, I can't add filebrowser to the TinyMCE :( Why?

Altri suggerimenti

See, {% url %} tag had some disadvantage in syntax: when you typing {% url app.views.view %} it can be read in two ways:

  1. You have your view function in app.views
  2. You have variable or object 'app' with method or key or property called 'views' and 'view' inside it.

It was ambiguous so since django 1.5 you should define your view location like a string: {% url 'app.views.view' %}.

BTW, i think there is no fork of django-filebrowser-no-grappelli with support django 1.5. I hope it will be soon

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top