I am trying to use the application
http://code.google.com/p/django-pagination/, that you proposed in the latest
post.
But getting an exception. Could you help to fix it please?
TemplateSyntaxError at /section/home
Caught an exception while rendering: 'request'
Original Traceback (most recent call last):
File "/opt/local/lib/python2.5/site-packages/django/template/debug.py",
line 71, in render_node
result = node.render(context)
File
"/opt/local/lib/python2.5/site-packages/django_pagination-1.0.5-py2.5.egg/pagination/templatetags/pagination_tags.py",
line 90, in render
page_obj = paginator.page(context['request'].page)
File "/opt/local/lib/python2.5/site-packages/django/template/context.py",
line 49, in __getitem__
raise KeyError(key)
KeyError: 'request'
Request Method: GET Request URL: http://127.0.0.1:8000/section/home
Exception
Type: TemplateSyntaxError Exception Value:
Caught an exception while rendering: 'request'
Original Traceback (most recent call last):
File "/opt/local/lib/python2.5/site-packages/django/template/debug.py",
line 71, in render_node
result = node.render(context)
File
"/opt/local/lib/python2.5/site-packages/django_pagination-1.0.5-py2.5.egg/pagination/templatetags/pagination_tags.py",
line 90, in render
page_obj = paginator.page(context['request'].page)
File "/opt/local/lib/python2.5/site-packages/django/template/context.py",
line 49, in __getitem__
raise KeyError(key)
KeyError: 'request'
On Mon, Sep 7, 2009 at 7:38 PM, Michael Ralan <[email protected]> wrote:
>
> It's possible to get digg-style pagination yes. What you need to do is
> this.
>
> Get the django-pagination add-on from the following url
>
> http://code.google.com/p/django-pagination/
>
> The documentation says unzip the pagination folder to a path
> accessible to python. This is usually taken to mean your site-packages
> folder. I couldn't do that because my app will be hosted on a server
> where I don't have that sort privilege.
>
> So what I did was to unzip it into a folder I did have access to.
> Because I'm running django using mod_wsgi there is a place I could add
> the following line to my initialization code. (Actually I added it to
> my projectfolder\apache\django.wsgi file). Unless the latter is
> already familiar to you probably have to scratch around somewhere.
>
> sys.path.append('g:/xampp/htdocs/pagination')
>
> From this point I followed the included documentation and it works!
>
> For the digg-look and feel I had to download some .css styling at
>
>
> http://mis-algoritmos.com/2007/03/16/some-styles-for-your-pagination/?page=2
>
> Hope this helps!
>
> Regards
>
> On Aug 17, 3:19 pm, sniper <[email protected]> wrote:
> > Hi,
> > Thanks for the help. I thought there would be django's official built
> > in
> > functionality which i might have missed, but looks like i have to
> > use unofficial third party code.
> >
> > On Aug 14, 6:49 pm, Benjamin Wohlwend <[email protected]> wrote:
> >
> > > Hi,
> >
> > > On Aug 14, 8:54 pm,sniper<[email protected]> wrote:
> >
> > > > I am asking this because in the admin page, the list page uses digg
> > > > style paging.
> >
> > > Like everything else that comes with Django, the admin app is open
> > > source, so nothing stops you from having a peek. This particular
> > > functionality can be found in django/contrib/admin/templatetags/
> > > admin_list.py, line 28[1]. The template tag has some admin-specifics
> > > in it, you'd have to copy the template tag and adjust it. Or, and this
> > > is probably what David so eloquently suggested, you could use one of
> > > the countless digg-style paginators for Django that float around the
> > > net. I'm quite fond of this[2] one because it extends the built-in
> > > pagination facilities instead of completely reinventing the wheel.
> >
> > > Kind regards,
> > > Benjamin
> >
> > > [1]
> http://code.djangoproject.com/browser/django/trunk/django/contrib/adm...
> > > [2]http://www.djangosnippets.org/snippets/773/
> --~--~---------~--~----~------------~-------~--~----~
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to [email protected]
> To unsubscribe from this group, send email to
> [email protected]<django-users%[email protected]>
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en
> -~----------~----~----~----~------~----~------~--~---
>
>
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/django-users?hl=.