Hi,
I’m trying to direct a page from index.html to pay_page.html. But where there is redirect(‘pay_page’), it doesn’t transfer to pay_page.html but get a page error saying, NoReverseMatch at/sign_up.
More about the error: Reverse for ‘pay_page’ not found. ‘Pay_page’ is not a valid view function or pattern name
Could someone tell me what I’m doing wrong?
Here’s my views.py:
from django.shortcuts import render, redirect
from django.core.mail import send_mail
def index(request):
return render(request, "index.html")
def sign_up(request):
password = request.POST['password']
return redirect('pay_page')
def pay_page(request):
return render(request, "pay_page.html")
Here’s my url.py:
from django.urls import path
from . import views
urlpatterns = [
path('', views.index),
path('sign_up', views.sign_up),
path('pay_page', views.pay_page),
]