#7768: HttpResponseRedirect causes a TypeError 'str' object is not callable in
base.py
------------------------------------------------------------------------+---
          Reporter:  William Martinez Pomares <[EMAIL PROTECTED]>  |         
Owner:  nobody
            Status:  new                                                |     
Milestone:        
         Component:  Core framework                                     |       
Version:  SVN   
        Resolution:                                                     |      
Keywords:        
             Stage:  Unreviewed                                         |     
Has_patch:  0     
        Needs_docs:  0                                                  |   
Needs_tests:  0     
Needs_better_patch:  0                                                  |  
------------------------------------------------------------------------+---
Old description:

> Working with SVN revision 7930, following the tutorial, up to the place
> where the votes view is created.
> The line in the vote() method
>    return HttpResponseRedirect(reverse('mysite.polls.views.results',
> args=(p.id,)))
>
> fails presenting a debug page that says:
>
> TypeError at /polls/1/results/
> 'str' object is not callable
> Request Method:         GET
> Request URL:    http://127.0.0.1:8000/polls/1/results/
> Exception Type:         TypeError
> Exception Value:        'str' object is not callable
> Exception Location:     C:\Python25\lib\site-
> packages\django\core\handlers\base.py in get_response, line 85
>
> I have found some relates issues (like 4700) that point to the
> INSTALLED_APPS settings and how the django.contrib.auth affects the
> get_response. I tried eliminating that application and still the error
> shows.
> If using HttpResponseRedirect without the reverse (hardcoding the url) it
> fails too. If using render_to_response() instead, it works.
>
> Another relate ticket may be 6442, but that one happens when the import
> error occurs. In this case the imports are ok in views.py, it is the
> HttpResponseRedirect that may have problems.
>
> William Martinez.

New description:

 Working with SVN revision 7930, following the tutorial, up to the place
 where the votes view is created.
 The line in the vote() method

 {{{
    return HttpResponseRedirect(reverse('mysite.polls.views.results',
 args=(p.id,)))
 }}}

 fails presenting a debug page that says:

 {{{
 TypeError at /polls/1/results/
 'str' object is not callable
 Request Method:         GET
 Request URL:    http://127.0.0.1:8000/polls/1/results/
 Exception Type:         TypeError
 Exception Value:        'str' object is not callable
 Exception Location:     C:\Python25\lib\site-
 packages\django\core\handlers\base.py in get_response, line 85
 }}}

 I have found some relates issues (like 4700) that point to the
 INSTALLED_APPS settings and how the django.contrib.auth affects the
 get_response. I tried eliminating that application and still the error
 shows.
 If using HttpResponseRedirect without the reverse (hardcoding the url) it
 fails too. If using render_to_response() instead, it works.

 Another relate ticket may be 6442, but that one happens when the import
 error occurs. In this case the imports are ok in views.py, it is the
 HttpResponseRedirect that may have problems.

 William Martinez.

Comment (by adrian):

 (Fixed formatting in description)

-- 
Ticket URL: <http://code.djangoproject.com/ticket/7768#comment:2>
Django Code <http://code.djangoproject.com/>
The web framework for perfectionists with deadlines
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to