1đź‘Ť
You have not created the default.html file. Flatpages look for a template named default.html. Here they insert their content. As you have not provided that file so flatpages raise the complaint for template does not exist.
To solve your problem follow these steps.
- Create a directory for templates in your project. Name it
“templates”. - In “templates” directory create a directory named
“flatpages”. - In “flatpages” directory create an html file named
“default.html”.
Graphically it would look something like this:
- Now in default.html enter the following
<!DOCTYPE html>
<html>
<head>
<title>{{ flatpage.title }}</title>
</head>
<body>
<h1>{{ flatpage.title }}</h1>
{{ flatpage.content }}
</body>
</html>
- Now in your settings file change the value of “TEMPLATE_DIRS” to point to this “templates” directory. It will look something like this:
TEMPLATE_DIRS = (
"/home/wasim/so/sopro/templates",
# Above insert your path
)
Replace the above path with your path for templates directory. Now run the server and it will work.
👤zkk
Source:stackexchange.com