-
-
- Книжный магазин
-
-
-
-
-
-
-
+{% extends 'base.html' %}
+{% load static %}
+
+{% block content %}
-
-
-
-
\ No newline at end of file
+{% endblock %}
diff --git a/market/settings.py b/market/settings.py
index 8629e50..54cdda6 100644
--- a/market/settings.py
+++ b/market/settings.py
@@ -57,7 +57,7 @@
TEMPLATES = [
{
'BACKEND': 'django.template.backends.django.DjangoTemplates',
- 'DIRS': [],
+ 'DIRS': [os.path.join(BASE_DIR, 'templates')],
'APP_DIRS': True,
'OPTIONS': {
'context_processors': [
diff --git a/templates/base.html b/templates/base.html
new file mode 100644
index 0000000..d596380
--- /dev/null
+++ b/templates/base.html
@@ -0,0 +1,28 @@
+{% load static %}
+
+
+
+ Книжный магазин
+
+
+
+
+
+
+
+
+ {% block content %}{% endblock %}
+
+
+
-
+{% extends 'base.html' %}
+{% load static %}
+
+{% block content %}
+
-
-
- 
-
- Название: Нащвние книги
- Название на английском: Book name
- Автор: Автор
- Количество страниц: 256
- Год выпуска: 2018
- Описание книги
-
+
+{% endblock %}
diff --git a/catalog/views.py b/catalog/views.py
index 7ee56af..75652d8 100644
--- a/catalog/views.py
+++ b/catalog/views.py
@@ -2,6 +2,7 @@
from django.shortcuts import render
from catalog.data import BOOKS
+
def detail(request, id):
books = list(filter(lambda b: b['id'] == id, BOOKS))
if len(books) == 0:
diff --git a/main/templates/main/index.html b/main/templates/main/index.html
index 543a753..8b51714 100644
--- a/main/templates/main/index.html
+++ b/main/templates/main/index.html
@@ -1,44 +1,28 @@
-
-
-
-
+
+
+
-
-
-
-
\ No newline at end of file
+
+
+
+
+
+
Название: {{ book.name }}
+ Название на английском: {{ book.name_eng }}
+ Автор: {{ book.author }}
+ Количество страниц: {{ book.pages }}
+ Год выпуска: {{ book.pub_year }}
+ {{ book.description }}