开发者

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜