你好,我有以下看法:class BookList(RequireLoginMixin, generic.ListView):
model = Book
template_name = 'book/list.html'
以及
^{2}$
我试图拒绝访问除主页之外的所有页面。在应用decorator或mixin之后,我试图访问的任何页面都会出现以下错误:^__debug__/
^admin/
^mwf/
The current URL, accounts/login/, didn't match any of these.
以下是我的URL配置:app_name = 'bookApp'
urlpatterns = [
url(r'^$', HomeView.as_view(), name='home'),
url(r'^about/$', AboutView.as_view(), name='about'),
url(r'^welcome/$', WelcomeView.as_view(), name='welcome'),
url(r'^fetch-books/$', fetch_book_author, name='fetch'),
url(r'^books/$', BookList.as_view(), name='books'),
url(r'^login/$', 'django.contrib.auth.views.login', name='login'),
url(r'^logout/$', 'django.contrib.auth.views.logout', kwargs={'next_page': '/mwf/'}),
url(r'^signup/$', UserRegistrationView.as_view(), name='signup'),
url('^', include('django.contrib.auth.urls')),
]
在我的设置中,我有:LOGIN_REDIRECT_URL = 'login/'
不知道这里怎么了。
非常感谢你的帮助