deprecation warning from HttpResponseRedirect(reverse(...))

115 views
Skip to first unread message

Mike

unread,
Aug 18, 2012, 2:24:33 AM8/18/12
to django...@googlegroups.com
I seem to be getting a  DeprecationWarning when my view hits this line of code:

  return HttpResponseRedirect(reverse(results, args=[query.jobid]))

I'm not directly using any generic views here.  Is this a bug?  If not, what is the right way to redirect to a different view?  That line of code is still in the tutorial so I assume that it is still the right way to do it.  I'm using Django 1.4.
thanks
Mike

pa...@aptivate.org

unread,
Aug 18, 2012, 7:31:42 AM8/18/12
to django...@googlegroups.com
> I seem to be getting a DeprecationWarning when my view hits this line of
> code:
>
> return HttpResponseRedirect(reverse(results, args=[query.jobid]))
>

What does the depreciation warning say?

Mike

unread,
Aug 18, 2012, 8:58:11 AM8/18/12
to django...@googlegroups.com
Here's the full text:
/Users/mike/sieve-django/SIEVEENV/lib/python2.6/site-packages/django/views/generic/simple.py:8: DeprecationWarning: Function-based generic views have been deprecated; use class-based views instead.
  DeprecationWarning 

Paul Backhouse

unread,
Aug 20, 2012, 6:01:04 AM8/20/12
to django...@googlegroups.com
Just importing a function from django.views.generic will trigger the
warning. So I'd check your code for imports.

I made tracking down the source of these warnings a little easier by
putting stacklevel into simple.py:

https://code.djangoproject.com/ticket/18780
> --
> You received this message because you are subscribed to the Google
> Groups "Django users" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/django-users/-/KvKw7JosFbIJ.
> To post to this group, send email to django...@googlegroups.com.
> To unsubscribe from this group, send email to django-users
> +unsub...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.


Reply all
Reply to author
Forward
0 new messages