Placing contents in home and book htmls

parent 3500650f
Pipeline #3060 canceled with stages
<!DOCTYPE html> {% extends 'base.html' %}
<html lang="en"> {% load static %}
<head>
<meta charset="UTF-8">
<title>Title</title>
</head>
<body>
</body> {% block title %}{% endblock %}
</html> {% block header %} header {% endblock %}
\ No newline at end of file {% block body %} body {% endblock %}
<!DOCTYPE html> {% extends 'base.html' %}
<html lang="en"> {% load static %}
<head>
<meta charset="UTF-8">
<title>Title</title>
</head>
<body>
</body> {% block title %}{% endblock %}
</html> {% block header %} header {% endblock %}
\ No newline at end of file {% block body %} body {% endblock %}
\ No newline at end of file
<!DOCTYPE html> {% extends 'base.html' %}
<html lang="en"> {% load static %}
<head>
<meta charset="UTF-8">
<title>Title</title>
</head>
<body>
</body> {% block title %}{% endblock %}
</html> {% block header %} header {% endblock %}
\ No newline at end of file {% block body %} body {% endblock %}
\ No newline at end of file
from django.shortcuts import render from django.http import render
from django.views import View from django.views.generic.detail import DetailView
from django.views.generic.list import ListView
from .models import Books, Author
def home_view(request): def home_view(request):
return render(request, 'bookshelf/home.html', {}) return render(request, 'bookshelf/home.html', {})
class HomeView(View): class BooksView(ListView):
def get(self,request): model = Books
return render(request, 'bookshelf/home.html', {})
class BooksView(View):
def get(self,request):
return render(request, 'bookshelf/books.html', {})
class BooksDetailView(View): class BooksDetailView(DetailView):
def get(self,request): model = Books
return render(request, 'bookshelf/books_detail.html', {})
class AuthorView(View): class AuthorView(ListView):
def get(self,request): model = Author
return render(request, 'bookshelf/author.html', {})
class AuthorDetailView(View): class AuthorDetailView(DetailView):
def get(self,request): model = Author
return render(request, 'bookshelf/author_details.html', {}) \ No newline at end of file
\ 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