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 ;-)