I have the following setup:
/landing_pages views.py urls.py
In urls.py I have the following that works when I try to access /competition :
from django.conf.urls.defaults import * from django.conf import settings from django.views.generic.simple import direct_to_template from django.contrib import admin admin.autodiscover() urlpatterns = patterns('', url(r'^competition$', 'landing_pages.views.page', {'page_name': 'competition'}, name="competition_landing"), )
My views.py has something like this:
def page(request, page_name): return HttpResponse('ok')
Then in the template, I try to do this:
{% load url from future %} <a href="{% url 'landing_pages.views.page' page_name='competition'%}"> Competition </a>
What I apparently can't do:
Caught NoReverseMatch on rendering: Reverse for 'landing_pages.views.page' with arguments' () 'and keyword arguments' {' page_name ': u'competition'} 'not found.
What am I doing wrong?
source share