I have made a Django application to show a list of clustered news articles. I want in the first page to show just a three of articles, and if the user wants to show them all, he can click the "See the real coverage" link and see the overall list of the articles (as GoogleNews functions). In the main page, I have the list of articles in a variable called lista. And I want to publish only the first three elements in the main page, and I want to transfer the list of articles in the the new page which, let's, I call theme. I add the theme function in the views.py file as:
def theme(request,argument):
lista=argument
return render(request,'theme.html', locals())
And the main.html code where i call the theme function is as follows:
<a href="{% url "mysite.views.theme" argument=lista %} target="_blank">
or I try:
<a href="{% url "mysite.views.theme" lista %} target="_blank">
The urls.py code is:
urlpatterns = patterns('',
('^main/$', main),
('^all/$', tegjitha),
('^(sport)/$', gen),
('^(teknologji)/$', gen),
('^(showbiz)/$', gen),
('^(bota)/$', gen),
('^(ekonomi)/$', gen),
('^(kulture)/$', gen),
('^(theme)/$', theme),
It gives me: NoReverseMatch at /main/ error.