Hello Malcolm, This is what I get...
Traceback: File "C:\Python25\Lib\site-packages\django\core\handlers\base.py" in get_response 86. response = callback(request, *callback_args, **callback_kwargs) File "C:\Python25\Lib\site-packages\Django-1.0\django\languagen\.. \languagen\questions\views.py" in answer 10. a = q.answers.get(question=q, pk=request.POST['answer']) File "C:\Python25\Lib\site-packages\django\utils\datastructures.py" in __getitem__ 203. raise MultiValueDictKeyError, "Key %r not found in %r" % (key, self) Exception Type: MultiValueDictKeyError at /questions/1/answer/ Exception Value: "Key 'answer' not found in <QueryDict: {}>" Any advice? On Jan 21, 2:24 pm, "saved...@gmail.com" <saved...@gmail.com> wrote: > Let me learn how to crawl before I can walk... > Thanks for your time.. > Ken > > On Jan 21, 10:48 am, "saved...@gmail.com" <saved...@gmail.com> wrote: > > > Hello Malcolm, > > Thanks for your response. I have thought very carefully before > > responding to your email. In no way was I ignoring your previous > > posts, I was trying to take the easy way, rather than the correct > > way. Furthermore, I really don't know how. > > I have spent hours trying to look it up, but to no avail. > > Would I place the print statements after each line of the view? > > Regards, > > Ken > > > On Jan 20, 10:13 pm, Malcolm Tredinnick <malc...@pointy-stick.com> > > wrote: > > > > On Tue, 2009-01-20 at 17:51 -0800, saved...@gmail.com wrote: > > > > Hello Malcolm, > > > > > Thanks for you reply. Unfortunately, there is no 404 error message. > > > > For some reason (beyond the scope of my django knowledge), the view > > > > just won't redirect. The scope of my django knowledge. Here are my > > > > simple urls, if that is of any assistance. > > > > > urlpatterns = patterns('django.views.generic.list_detail', > > > > (r'^$', 'object_list', info_dict), > > > > (r'^(?P<object_id>\d+)/answer/$', 'object_detail', info_dict), > > > > ) > > > > urlpatterns += patterns('', > > > > (r'^(?P<question_id>\d+)/answer/$', > > > > 'languagen.questions.views.answer'), > > > > ) > > > > > I'm not sure on how I should > > > > Stop trying to debug this through the browser and be prepared to debug > > > the Python code. I've suggested twice now (this is the third time) that > > > you put some print statements in your code to show the values of various > > > variables. > > > > If you're running with Django's runserver, they will print to the > > > console. If you're serving your pages through something like Apache, > > > print to sys.stderr and the output will go the http error log. > > > > Attempting to debug this in the browser is like trying to bake a cake > > > whilst being at the other end of the house from the kitchen. You have to > > > get closer to the problem. Use the browser to trigger the problem (i.e. > > > request the page), but it's your Python code that is behaving > > > erratically, so debug that, not the browser output. > > > > Put in a print statement to work out which branch of the "if" test is > > > being taken. Print out the value of q.next.get_absolute_url(). Print out > > > anything else that might help you decide which lines of code are being > > > executed. This is very normal debugging technique. > > > > Regards, > > > Malcolm --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~----------~----~----~----~------~----~------~--~---