getting except ObjectDoesNotExist to direct to a view in Django
I need a way to return a redirect to a view if ObjectDoesNotExist is True. I was trying this:
except ObjectDoesNotExist:
return HttpResponseRedirect(reverse开发者_开发问答('create_profile'))
But I'm getting arg and kwarg arguements, which makes sense.
But am I thinking about this the right way?
Suggestions welcome.
Supply to reverse()
the values that the create_profile
view would normally take.
精彩评论