如何在 Django 中指定 login_required 重定向 url? [英] How to specify the login_required redirect url in django?
本文介绍了如何在 Django 中指定 login_required 重定向 url?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一个视图函数:
@login_required
def myview():
# do something
# respond something
pass
如何为要重定向的视图函数指定确切的 URL?
How can I specify the exact URL for this view function to be redirected?
推荐答案
您设置中的 LOGIN_URL
LOGIN_URL in your settings
参考:
这篇关于如何在 Django 中指定 login_required 重定向 url?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文