帐户/注册错误:为什么不起作用

时间:2019-05-04 17:22:22

标签: django-models django-rest-framework django-forms django-views

我正在使用Django框架开发一个名为btre_proect的项目,现在我正在使用Register,但是发现了404错误,

我的urls.py(帐户)代码是

  from django.urls import path


  from . import views

  urlpatterns = [
      path('login', views.login, name='login'),
      path('register', views.register, name='register'),
      path('logout', views.logout, name='logout'),
      path('dashboard', views.dashboard,name='dashboard')

  ]

urls.py(btre_project)代码是

   from django.contrib import admin
   from django.urls import path,include
   from django.conf import settings
   from django.conf.urls.static import static


   urlpatterns = [
       path('',include('pages.urls')),
       path('listings/',include('listings.urls')),
       path('accounts/',include('accounts.urls')),
       path('admin/', admin.site.urls),
       ] + 
      static(settings.MEDIA_URL,document_root=settings.MEDIA_ROOT)

我遇到这种类型的错误

enter image description here

1 个答案:

答案 0 :(得分:0)

哦,我得到了答案,views.py(urls.py)中出现错误,最终找到了它