I’m trying to render this html page but it won’t work , I’m currently using Django version 4.2.7 Before I updated, it rendered with other projects, but now it’s not working .I tried DIRS [‘templates’] , DIRS[ BASIC_DIRS] and os.join.path [BASIC_DIRS ,'templates] but it said that the os wasn’t identified in my setting py for my project .
Here is my views.py and I did include my app in the INSTALLED APPS in my settings.py.
from django.shortcuts import render
from django.http import HttpResponse
# `Create your views here.
def index(request):
return render(request, "blue/index.html")
def greet(request, name):
return HttpResponse(f"Hello,{name.capitalize()}!")
url.py for my app specifically,
from django.urls import path
from . import views
urlpatterns = [
path("", views.index, name="index"),
path("<str:name>", views.greet, name="greet")
]
my url.py for my project
from django.contrib import admin
from django.urls import path, include
urlpatterns = [
path('admin/', admin.site.urls),
path('red/', include("red.urls"))
]