joashivanmoodley / django-pagination

Automatically exported from code.google.com/p/django-pagination
BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

Caught an exception while rendering: 'request' #48

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Installed django-pagination
2. followed steps for setup
3. watched tutorial and set up settings.py exactally like the video

What is the expected output? What do you see instead?
Expected to see page templated rendered with 25 results. Instead I get the
error message "Caught an exception while rendering: 'request'"

What version of the product are you using? On what operating system?
Using verison 1.0.5 on Windows Vista

Please provide any additional information below.

I followed the advice in Issue 20 and added "from django.template import
RequestContext" to the view.py and 'django.core.context_processors.request'
is added in Template_Context_Processors. I have no idea why this is not
working.

Here is my template

11      
12  <p>The number of records: {{lobbyists|length}} </p>
13  
14  {% endif %}
15  
16  <p> This table contains all firms and individuals who lobbied on behalf
of {{country}}.</p>
17  
18  <table border ="2">
19  
20  <th>Firm</th><th>Client</th><th>Country</th><th>Amount</th><th>Type of
Lobbying</th><th>Year</th>
21  {% autopaginate lobbyists 25 %}
22  {% for lobbyist in lobbyists %}
23  <tr>
24  <td><a
href="{{lobbyist.reg_cd.get_absolute_url}}">{{lobbyist.reg_cd}}</a></td>
25  <td><a
href="{{lobbyist.fp_cd.get_absolute_url}}">{{lobbyist.fp_cd}}</a></td>
26  <td>{{lobbyist.country}}</td>
27  <td>{{lobbyist.financial_amount}}</td>
28  <td><a
href="{{lobbyist.act_type.get_absolute_url}}">{{lobbyist.act_type}}</a></td>
29  <td>{{lobbyist.year}}</td>
30  </tr>
31  

Original issue reported on code.google.com by nixon....@gmail.com on 23 Apr 2009 at 3:02

GoogleCodeExporter commented 8 years ago
Got it to work. Added context_instance=RequestContext(request)) to the view.

Original comment by nixon....@gmail.com on 23 Apr 2009 at 3:59