Using django-paging extension with Django and Jinja2/Coffin
Recently I switched my templating engine from default to Jinja2/Coffin. Everything works just fine but I'm having troubles trying to use Django/Jinja2 django-paging (http://linux.softpedia.com/get/Internet/HTTP-WWW-/django-paging-58496.shtml) extension in my project.
There is an example how to use this extension with Jinja:
{% with paginate(request, my_queryset) as results %}
{{ results.paging }}
{% for result in results.objects %}
{{ result }}
{% endfor %}
{{ results.paging }}
{% endwith %}
Simply, I don't know where and how to define this new tag paginate to be recognized by Jinja2 engine.
I tried to put is in settings.py as:
JINJA2_EXTENSIONS = (
'paging.helpers.paginate',
)
but the error is raised:
paginate() takes at least 2 arguments (1 given)
开发者_JS百科Any help is appreciated.
Ok, problem solved. The paging application should be added into INSTALLED_APPS (settings.py)
精彩评论