我对 Django 有疑问。实际上我想在我的新站点中创建一个登录面板,但是当我尝试编写地址时,调试器会响应我一个错误:
Page not found (404)
Request Method: GET
Request URL: http://localhost:8000/account/login
Using the URLconf defined in firmowa.urls, Django tried these URL patterns, in this order:
admin/
^account/
The current path, account/login, didn't match any of these.
我的firmowa.urls 是
from django.contrib import admin
from django.urls import path, include
urlpatterns = [
path('admin/', admin.site.urls),
path(r'^account/', include('account.urls')),
]
项目 urls.py 是:
from django.urls import path
from . import views
urlpatterns = [
path(r'^login/$', views.user_login, name='login'),
]
我正在寻找几个小时的解决方案,但仍然没有。