NoReverseMatch at /

后端 未结 3 1239
迷失自我
迷失自我 2021-02-02 18:23

I am trying to make pretty meaningful urls, but I guess I\'m doing it wrong.

This works:

from django.conf.urls.defaults import patterns, url
from places.         


        
3条回答
  •  陌清茗
    陌清茗 (楼主)
    2021-02-02 18:38

    For me, I forgot the namespace of the Route. Instead of

    {% url 'login' %}
    

    I should have written

    {% url 'accounts:login' %}
    

    with this configuration:

    # root URLs
    url(r'^accounts/', include('myproject.accounts.accounts.urls', namespace='accounts'))
    
    # accounts URLs
    url(r'^login$', views.login, name='login')
    

提交回复
热议问题