Django 2.0 - Not a valid view function or pattern name (Customizing Auth views)

前端 未结 2 1164
孤街浪徒
孤街浪徒 2020-12-29 06:19

I´m working on a course exercise and I\'m stuck for a few hours and I\'m not sure what is causing the app to break, next, you will find the files involved and perhaps you ca

2条回答
  •  天涯浪人
    2020-12-29 06:33

    You've set a namespace for your urls:

    app_name = 'account'
    

    You need to use that namespace when reversing urls with reverse/reverse_lazy or {% url %}:

    LOGIN_REDIRECT_URL = reverse_lazy('account:dashboard')
    LOGIN_URL = reverse_lazy('account:login')
    LOGOUT_REDIRECT_URL = reverse_lazy('account:logout')
    

提交回复
热议问题