account/register not found in django project

I am new to django and started with a basic. The problem is while following a tutorial I created an account app that has a register page. For some reason whenever I am trying to go to my register page, django tells me that it doesn’t match any of the paths.

below is the given code: accounts app

from django.urls import path
from . import views
urlpatterns = [
    path('register', views.register, name="register")

accounts app’s views

from django.shortcuts import render

def register(request):
    return render(request, 'register.html')

register.html is:

<!DOCTYPE html>
<html lang="en">
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <form action="register" method = "post">
        {% csrf_token %}
        <input type= "text" name="first_name" placeholder="First Name"><br>
        <input type= "text" name="last_name" placeholder="Last Name"><br>
        <input type= "text" name="username" placeholder="UserName"><br>
        <input type= "text" name="password1" placeholder="Password"><br>
        <input type= "text" name="password2" placeholder="Verify Password"><br>
        <input type= "submit">
from django.contrib import admin
from django.urls import include, path
from django.conf import settings
from django.conf.urls.static import static

urlpatterns = [
    path("", include('travello.urls')),
    path('accounts/', include('accounts.urls')),
urlpatterns = urlpatterns + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)

the error I am getting is given below:

Page not found (404)
Request Method: GET
Request URL:
Using the URLconf defined in web_project.urls, Django tried these URL patterns, in this order:

accounts/ register [name='register']
The current path, accounts/register.html, didn’t match any of these.

You’re seeing this error because you have DEBUG = True in your Django settings file. Change that to False, and Django will display a standard 404 page.

P.s: I know this question has been asked before but I tried everything still unable to understand where I am making a mistake.


You forgot to add / to your URL

path('register/', views.register, name="register")

in make:

        'DIRS': ['templates'],