我正在尝试使用Django的帐户系统,包括@login_required装饰器.我的settings.py文件包含django.contrib.auth
,我已经完成了syncdb.
Page not found (404) Request Method: GET Request URL: http://localhost:8000/accounts/login/?next=/ Using the URLconf defined in dashboard.urls, Django tried these URL patterns, in this order: ^$ [name='home'] The current URL, accounts/login/, didn't match any of these. You're seeing this error because you have DEBUG = True in your Django settings file. Change that to False, and Django will display a standard 404 page.
在尝试@ login_required-decorate我的主视图后,我看到了上面的内容.
它似乎很窒息,因为它被重定向到accounts/login /,我还没有在urls.py中准备好.
我可以添加到urls.py或其他地方,以便login_required装饰器将执行其通常的行为?
谢谢,