Commit 10e37df4 authored by Gabriel G. Garrero's avatar Gabriel G. Garrero

Created html files for Books, Book Details, Authors, and Author Details and updated urls.py

parent 7e998f74
{% extends 'base.html' %}
{% load static %}
{% block title %}{% endblock %}
{% block content %}
{% endblock %}
\ No newline at end of file
{% extends 'base.html' %}
{% load static %}
{% block title %}{% endblock %}
{% block content %}
{% endblock %}
\ No newline at end of file
{% extends 'base.html' %}
{% load static %}
{% block title %}{% endblock %}
{% block content %}
{% endblock %}
\ No newline at end of file
{% extends 'base.html' %}
{% load static %}
{% block title %}{% endblock %}
{% block content %}
{% endblock %}
\ No newline at end of file
......@@ -5,7 +5,7 @@
{% block title %}My Favorite Books & Authors{% endblock %}
{% block content %}
<h1 id="hello">Welcome to Gabi's Database of Favorite Books and Authors!</h1>
<h1>Welcome to Gabi's Database of Favorite Books and Authors!</h1>
<p>I don't read books.</p>
......
......@@ -3,6 +3,10 @@ from . import views
urlpatterns = [
path('home/', views.home, name = 'home'),
path('books/', views.BooksListView.as_view(), name = 'books-list'),
path('books/<int:pk>/details', views.BooksDetailView.as_view(), name = 'books-details'),
path('authors/', views.AuthorListView.as_view(), name = 'author-list'),
path('authors/<int:pk>/details', views.AuthorDetailView.as_view(), name = 'author-details'),
]
app_name = "bookshelf"
\ No newline at end of file
from django.http import HttpResponse
from .models import Author, Books
from django.template import loader
from django.shortcuts import render
from django.views import View
from django.views.generic.list import ListView
from django.views.generic.detail import DetailView
from .models import Author, Books
def home(request):
return render(request, 'bookshelf/home.html')
\ No newline at end of file
return render(request, 'bookshelf/home.html')
class BooksListView(ListView):
model = Books
class BooksDetailView(DetailView):
model = Books
class AuthorListView(ListView):
model = Author
class AuthorDetailView(DetailView):
model = Author
\ No newline at end of file
<!DOCTYPE html>
<html lang="en">
<html lang = "en">
<head>
<link rel="stylesheet" href="/static/styles.css">
<link rel = "stylesheet" href = "/static/styles.css">
<title>{% block title %}My amazing site{% endblock %}</title>
{% block styles %}{% endblock %}
</head>
<body>
<div id="content">
<div id = "content">
{% block content %}{% endblock %}
</div>
{% block scripts %}{% endblock %}
......
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