Commit 0eafd77f authored by Julia Anishka's avatar Julia Anishka

fixedd home format

parent 0a3547f4
{% extends 'base.html' %} {% extends 'base.html' %}
{% block title %} My Favorite Books & Authors {% endblock %}
{% block body %} {% block body %}
<h1> My Favorite Books & Authors </h1>
<h3><center> Welcome to Nisha's Database of <br> Favorite Books and Authors! </center></h3> <h3><center> Welcome to Nisha's Database of <br> Favorite Books and Authors! </center></h3>
<p> The genres I usually enjoy include mystery, romance, and fantasy. From narratives <p> The genres I usually enjoy include mystery, romance, and fantasy. From narratives
that revolve around crimes to supernatural elements in a fictional world, I find each that revolve around crimes to supernatural elements in a fictional world, I find each
......
from django.urls import path from django.urls import path
from . import views from . import views
from .views import BooksListView
urlpatterns = [ urlpatterns = [
path('home', views.homepage_view, name='home') path('home', views.homepage_view, name='home'),
path('books', BooksView.as_view(), name='books') path('books', BooksListView.as_view(), name='books-list')
] ]
......
from django.shortcuts import render from django.shortcuts import render
from django.http import HttpResponse from django.http import HttpResponse
from django.views import View from django.views import View
from django.views.generic.list import ListView
from django.views.generic.detail import DetailView
from .models import Author, Books from .models import Author, Books
...@@ -13,3 +15,5 @@ def homepage_view(request): ...@@ -13,3 +15,5 @@ def homepage_view(request):
} }
return render(request, 'home.html', context) return render(request, 'home.html', context)
class BooksListView(ListView):
model = Books
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