No problem at all, glad it worked out for you :-)
Good luck with the rest of the tutorial
Cheers
On Thursday, 14 November 2013 12:16:06 UTC, Amimo Benja wrote:
>
> Thanks Lee, it worked. The problem was I had not passed category_name_url
> from my view function to the category template. The moment I passed it, it
> worked without any problem. Thanks a lot Man. At least I can proceed.
> Phee...w!!! Thanks again.
>
> On Thursday, November 14, 2013 3:08:27 PM UTC+3, Lee wrote:
>>
>> Noob here so I may be way wrong but it looks to me like your problem is
>> probably in link in category page when generating the link to add_page,
>> given the url in the error is missing the category name in the URL. Have
>> you passed category_name_url from your view function to the category
>> template? Your views.py link seems to show forms.py rather than the view
>> functions so I cant see the view, but my category view looks as follows and
>> works:
>>
>> def category(request, category_name_url):
>> context = RequestContext(request)
>> category_name = decode_url(category_name_url)
>> context_dict = {'category_name': category_name, 'category_name_url':
>> category_name_url}
>>
>> try:
>> category = Category.objects.get(name=category_name)
>> pages = Page.objects.filter(category=category)
>> context_dict['pages'] = pages
>> context_dict['category'] = category
>> except Category.DoesNotExist:
>> pass
>>
>> return render_to_response('rango/category.html', context_dict, context)
>>
>> And I am also mid way through Tango with Django if you hadn't guessed ;-)
>>
>>
>> On Wednesday, 13 November 2013 12:14:40 UTC, Amimo Benja wrote:
>>>
>>> Hey all,
>>>
>>> Am currently practicing using this tutorial
>>> http://www.tangowithdjango.com/book/chapters/forms.html, but I'm
>>> constantly getting this error "The current URL,
>>> rango/category//add_page/, didn't match any of these." every time I
>>> click on the Add a Page<http://127.0.0.1:8000/rango/category//add_page/>
>>> link
>>> in the Category.html. I don't know how to solve it. Any help? Thanks.
>>>
>>> Here are my
>>> 1. Views.py http://pastebin.mozilla.org/3595121
>>> 2. rango/urls.py http://pastebin.mozilla.org/3595145
>>> 3. add_page.html http://pastebin.mozilla.org/3595156
>>> 4. category.html http://pastebin.mozilla.org/3595158
>>>
>>>
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-users/cdef43db-8232-41eb-b5eb-5f898e3ca4ab%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.