5π
β
The first problem is that both the path to the views.index
and views.terms
share the same path. As a result, you have made views.terms
inaccessible.
You thus should change one of the paths, for example:
from django.urls import path
from . import views
urlpatterns = [
path('', views.index, name='index'),
path('terms/', views.terms, name='terms')
]
You better use the {% url ... %}
template tag [Django-doc] to resolve the URLs, since if you later decide to change the path of a certain view, you can still calculate the path.
In your template, you thus write:
By signing in, you agree to our <a href="{% url 'terms' %}">Terms Of Use Policy</a>
1π
urlpatterns = [
path('', views.index, name="index"),
path('terms/', views.terms, name="terms")
]
By signing in, you agree to our <a href="{% url 'terms' %}">Terms Of Use Policy</a>
or
π€arjun
- [Django]-Django-Oscar with AWS S3 save images correctly
- [Django]-Django β 'module' object is not callable
- [Django]-Dynamicly update the queryset of ModelMultipleChoiceField in ModelForm
- [Django]-Using session key of Django session as foreign key
- [Django]-Django : When is sessionid cookie set ? [ Is it available by default ? ]
Source:stackexchange.com