A
A
ATD1fficult2022-02-11 00:19:04
Django
ATD1fficult, 2022-02-11 00:19:04

After I create an html template and try to use it on the site, the site does not work with a ValueError, why?

I am just starting to learn python Django. Now I'm trying to display information as an html page. But doing everything seems right, Django stubbornly gives me an error. How to fix it?
HTML 5 file

<!doctype html>
<html lang="ru">
<head>
    <meta charset="UTF-8">
    <meta name="viewport"
          content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Тайтл</title>
</head>
<body>
    <h1>Вот так вот</h1>
</body>
</html>

urls.py
from NotAnApplication import views
from django.contrib import admin
from django.urls import path

urlpatterns = [
    path('admin/', admin.site.urls),
    path('', views.slave)
]

views.py
from django.shortcuts import render
def slave(request):
    render(request, 'NotAnApplication/just.html')


This is what the site gives out:
620581182dd91867041657.png

Answer the question

In order to leave comments, you need to log in

1 answer(s)
G
galaxy, 2022-02-11
@ATD1fficult

-render(request, 'NotAnApplication/just.html')
+return render(request, 'NotAnApplication/just.html')

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question