How to load a template with views and render

I am new to django and I am trying to have my template be used in my project. Based on my understanding includes a url pattern variable that uses the path function. in the path function there is the url itself, view logic, and the name = variable that is used as a reference point. So when does django find out about the template? In the

So i go to and it talks about the render function. Per the official tutorial and the documentation

“The render function takes the request object as its first argument, a template name as its second argument and a dictionary as its optional third argument.”


# quote/
from django.urls import path 

from .views import customer_page

urlpatterns = [path("/customer", customer_page)]

from django.shortcuts import render
from django.http import HttpResponse

# need to import views in the of quote 

# Create your views here.

def customer_page(request): 
    return render(request, "quote/customer.html")

Error Message

Using the URLconf defined in web_scrap_cloud.urls, Django tried these URL patterns, in this order:

customer /customer
The current path, customer, didn’t match any of these.

This issue is related to your url definition and has nothing to do with your templates.

You show a segment from your quote/ file. Is this your app’s file, or your project file? If it is your app’s file, please post your root file.

Side note: The error message lists the urls that you have defined. You do not have a url “customer”.

The code snippiet above is the app

Here is the project level

URL configuration for web_scrap_cloud project.

The `urlpatterns` list routes URLs to views. For more information please see:
Function views
    1. Add an import:  from my_app import views
    2. Add a URL to urlpatterns:  path('', views.home, name='home')
Class-based views
    1. Add an import:  from other_app.views import Home
    2. Add a URL to urlpatterns:  path('', Home.as_view(), name='home')
Including another URLconf
    1. Import the include() function: from django.urls import include, path
    2. Add a URL to urlpatterns:  path('blog/', include('blog.urls'))

# -> django_project url 
from django.contrib import admin
from django.urls import path, include 

urlpatterns = [
    path("customer/", include("quote.urls")),

per the documentation for path

path(route, view, kwargs=None, name=None)¶

My guess is, I am either misusing the include() statement or I do not have a view.

If you go to /customer//customer you should see the result you’re expecting.
This happens because you’re including all of the inside the quote.urls “after” (under) the path /customer and on that file all urls will be prefixed with /customer

In this case i would:

  • Change the prefix on the root url_conf (the one with the include) to something like quote to create a namespace for all the urls inside the quote.urls file:
urlpatterns = [
    path("quote/", include("quote.urls")),
  • Change the url for the view on the quote/
urlpatterns = [path("customer", customer_page)]
# notice how i removed the prefix slash

Now you can view your view on /quote/customer