For some reason Django is saying my template does not exist. Yet I clearly have an .html folder template. It must not be recognizing it? Can anyone advise me?
#views.py
from django.shortcuts import render
from django.urls import path
from django.http import HttpResponse
# Create your views here.
def finance(request):
return HttpResponse('Here are our business results')
def home(request):
return render(request,'home.html')
def ingredients(request):
return HttpResponse('Here is the ingredients page')
def menu(request):
return HttpResponse('Here is the menu page!')
def purchases(request):
return HttpResponse('Here is where you can find the order history!')
urls.py
from django.contrib import admin
from django.urls import path, include
from inventory.views import finance, home, ingredients, menu, purchases
from inventory import views
from django.views.generic.base import TemplateView
from django.http import HttpResponse
urlpatterns = [
path('', views.home, name='default'), # users don't need to see the rocket page anyway. they need to see the home page.
path('admin/', admin.site.urls),
path('finance/', finance, name='finance'),
path('home/', home, name='home'), #I am attempting to connect the home_view function with the views function.
path('ingredients/', ingredients, name='ingredients'),
path('menu/', menu, name='menu'),
path('purchases/', purchases, name='purchases'),
]
templates/inventory/
base.html
finance.html
home.html
ingredients.html
menu.html
purchases.html