Answer the question
In order to leave comments, you need to log in
Reverse() function or url template tag?
Hello,
I'm practicing with routing in Django. There is a weblog/urls.py file with the following content:
from django.conf.urls import patterns, include, url
urlpatterns = patterns('',
url(r'^(?P<year>\d{4}/)?((?P<month>\d{2})/)?(page/(?P<page>\d+)/)?$', 'weblog.views.posts', name='home'),
)
<a href="{% url home page=posts.next_page_number %}">Next</a>
Reverse for 'home' with arguments '()' and keyword arguments '{'page': 2}' not found.
Answer the question
In order to leave comments, you need to log in
Do you have the year, month, page parameters in the weblog.views.posts view as arguments?
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question