Commit 3e5c3327 authored by Trisha Angel Millena's avatar Trisha Angel Millena

Edited urls.py under bookshelf

parent 920c1143
{% 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
from django.urls import path
from . import views
from .views import (
index, BookListView, BookDetailView, AuthorListView, AuthorDetailView
)
urlpatterns = [
path('home/', views.home, name = 'home'),
path('books/', views.BooksListView.as_view(), name = 'book-details'),
path('books/<int:pk>/details', BookDetailView.as_view(), name = 'book-details'),
path('authors/', AuthorListView.as_view(), name = 'author-list'),
path('author/<int:pk>/details', AuthorDetailView.as_view(), name = 'author-details'),
]
app_name = "bookshelf"
\ No newline at end of file
from django.http import HttpResponse
from django.shortcuts import render
from django.views import View
from django.views.generic.list import ListView
from django.views.generic.detatil import DetailView
from .models import Author, Books
# Create your views here.
def home(request):
return render(request, 'bookshelf/home.html')
\ No newline at end of file
return render(request, 'bookshelf/home.html')
class BookListView(ListView):
model = Books
class BookDetailView(DetailView):
model = Books
class AuthorListView(ListView):
model = Author
class AuthorDetailView(DetailView):
model = Author
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