Tango with Django tutorial, problem getting category function to pass a variable

399 views
Skip to first unread message

Jimmy Pants

unread,
Oct 27, 2013, 9:01:06 AM10/27/13
to django...@googlegroups.com
Hey yall

Here is my current views.py:

http://pastebin.mozilla.org/3361332

PROBLEM:

I'm trying to add an "Add Page" form to the project, per the tutorial at this step:

http://www.tangowithdjango.com/book/chapters/forms.html#creating-an-add-pages-view-template-and-url-mapping

When I click on "Add Page" in a category view, I get

TypeError at /rango/add_page/

add_page() takes exactly 2 arguments (1 given)


THOUGHTS:

So far as I can tell, line 60 adds category_name_url to context_dict, which means that category_name_url should go into the context that gets passed on.. or else I am seriously failing to grasp this, which is the more likely idea. I'm pretty sure I can't just add another argument to the render_to_response, so the only other option I can think of is to put a dictionary in the render_to_response, which includes category_name_url... BUT I don't know what all else is in the context_dict at that point.

been fiddling with this for a couple hours now, seemingly getting nowhere. I based my current code on the stuff here.

J. Paskaruk

unread,
Oct 27, 2013, 1:04:53 PM10/27/13
to Patti Chen, django...@googlegroups.com
Thank you! My thinking was all muddled, and that at least got me moved on to a new error at least - I never lose heart, as long as I'm generating new and revealing forms of errors, but I even my errors had stalled at that point. Anyways, I just got it done. Cheers :>


On Sun, Oct 27, 2013 at 7:20 AM, Patti Chen <craft...@gmail.com> wrote:
Hi Jimmy,

Could you please check your urls.py?
You need to pass category_name_url in url mapping. Read this section in the book and check this.




--
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 django-users...@googlegroups.com.


Patti Chen

unread,
Oct 27, 2013, 12:20:23 PM10/27/13
to django...@googlegroups.com, jpas...@gmail.com
Hi Jimmy,

Could you please check your urls.py?
You need to pass category_name_url in url mapping. Read this section in the book and check this.


On Sun, Oct 27, 2013 at 5:01 PM, Jimmy Pants <jpas...@gmail.com> wrote:

--

Amimo Benja

unread,
Nov 13, 2013, 12:18:12 PM11/13/13
to django...@googlegroups.com
Hi Jimmy am currently facing an error that "The current URL, rango/category//add_page/, didn't match any of these." How did you resolve it?

Sergiy Khohlov

unread,
Nov 13, 2013, 12:22:29 PM11/13/13
to django-users
check your template. or html
Many thanks,

Serge


+380 636150445
skype: skhohlov
> --
> 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 django-users...@googlegroups.com.
> To post to this group, send email to django...@googlegroups.com.
> 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/16e7b037-bccb-4577-9458-de534b242a3b%40googlegroups.com.

Amimo Benja

unread,
Nov 13, 2013, 12:26:41 PM11/13/13
to django...@googlegroups.com
More details please.


You received this message because you are subscribed to a topic in the Google Groups "Django users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/django-users/27JudVqDgD8/unsubscribe.
To unsubscribe from this group and all its topics, send an email to django-users...@googlegroups.com.

To post to this group, send email to django...@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
Reply all
Reply to author
Forward
0 new messages