• Reverse for ‘logout’ not found. ‘logout’ is not a valid view function or pattern name.

    django.urls.exceptions.NoReverseMatch: Reverse for ‘logout’ not found. ‘logout’ is not a valid view function or pattern name.

     

    Titanium Asked on June 26, 2018 in Python.
    Add Comment
  • 1 Answer(s)
    Best answer

    You have a comma in the regex that shouldn’t be there. Replace

     

    url(r'^logout/$,', views.logoutView, name='logout'),
    
    with
    url(r'^logout/$', views.logout, name='logout'),
    

     

    Titanium Answered on June 26, 2018.
    Add Comment
  • Your Answer

    By posting your answer, you agree to the privacy policy and terms of service.