Placing contents in home and book htmls

parent 3500650f
Pipeline #3060 canceled with stages
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
</head>
<body>
{% extends 'base.html' %}
{% load static %}
</body>
</html>
\ No newline at end of file
{% block title %}{% endblock %}
{% block header %} header {% endblock %}
{% block body %} body {% endblock %}
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
</head>
<body>
{% extends 'base.html' %}
{% load static %}
</body>
</html>
\ No newline at end of file
{% block title %}{% endblock %}
{% block header %} header {% endblock %}
{% block body %} body {% endblock %}
\ No newline at end of file
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
</head>
<body>
{% extends 'base.html' %}
{% load static %}
</body>
</html>
\ No newline at end of file
{% block title %}{% endblock %}
{% block header %} header {% endblock %}
{% block body %} body {% endblock %}
\ No newline at end of file
from django.shortcuts import render
from django.views import View
from django.http import render
from django.views.generic.detail import DetailView
from django.views.generic.list import ListView
from .models import Books, Author
def home_view(request):
return render(request, 'bookshelf/home.html', {})
class HomeView(View):
def get(self,request):
return render(request, 'bookshelf/home.html', {})
class BooksView(View):
def get(self,request):
return render(request, 'bookshelf/books.html', {})
class BooksView(ListView):
model = Books
class BooksDetailView(View):
def get(self,request):
return render(request, 'bookshelf/books_detail.html', {})
class BooksDetailView(DetailView):
model = Books
class AuthorView(View):
def get(self,request):
return render(request, 'bookshelf/author.html', {})
class AuthorView(ListView):
model = Author
class AuthorDetailView(View):
def get(self,request):
return render(request, 'bookshelf/author_details.html', {})
\ No newline at end of file
class AuthorDetailView(DetailView):
model = Author
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment