Reputation: 13
I've been trying to figure this out, but can't seem to catch my error.
In my Django 1.6 project I have two apps: hold
and control
urls.py
url(r'^control/$', include('control.urls')),
control/urls.py
url(r'^$', views.index, name='control_home'),
#this doesn't work
url(r'^invite/$', views.control_invite, name='control_invite'),
views.py
def index(request):
return render(request, 'control_index.html')
def control_invite(request):
return render(request, 'control_invite.html')
control_index.html
<li class="active"><a href="{% url 'control_home' %}">Control</a></li>
<li><a href="{% url 'control_invite' %}">Invitations</a></li>
Reverse for 'control_invite' with arguments '()' and keyword arguments '{}' not found. 1 pattern(s) tried: ['control/$invite/$']
I get the same error in the shell. Not sure what I'm missing...
Upvotes: 1
Views: 472
Reputation: 18427
You have a $
sign at the end of your main urls.py which means the pattern should end at control/
and not allow any more sub-urls. Change it to this:
url(r'^control/', include('control.urls')),
Upvotes: 3
Reputation: 39659
Project urls.py
should be:
url(r'^control/', include('control.urls')),
There is no need for $
(it means nothing comes after that).
Upvotes: 1