How to specify the login_required redirect url in django?

后端 未结 7 1265
既然无缘
既然无缘 2020-12-13 23:04

I have a view function:

@login_required
def myview():
    # do something
    # respond something
    pass

How can I specify the exact URL f

相关标签:
7条回答
  • 2020-12-14 00:01

    you can also take url from view

    for example

    path('login/', login_view, name='login_name'),
    

    then decoratorwill be

    @login_required(login_url='login_name')
    
    0 讨论(0)
提交回复
热议问题