Commit 54404855 authored by Brendan Fausto's avatar Brendan Fausto

Added URLS for bookcreateview and authorcreateview

parent c5c3a554
# about/urls.py # about/urls.py
from django.urls import path from django.urls import path
from .views import (home_view, AuthorListView, BookListView, BookDetailView, AuthorDetailView) from .views import (home_view, AuthorListView, BookListView, BookDetailView, AuthorDetailView, BookCreateView, AuthorCreateView)
urlpatterns = [ urlpatterns = [
path('home', home_view, name='index'), path('home', home_view, name='index'),
...@@ -9,6 +9,8 @@ urlpatterns = [ ...@@ -9,6 +9,8 @@ urlpatterns = [
path('authors', AuthorListView.as_view(), name='author-list'), path('authors', AuthorListView.as_view(), name='author-list'),
path('books/<int:pk>/details', BookDetailView.as_view(), name='books-details'), path('books/<int:pk>/details', BookDetailView.as_view(), name='books-details'),
path('authors/<int:pk>/details', AuthorDetailView.as_view(), name='authors-details'), path('authors/<int:pk>/details', AuthorDetailView.as_view(), name='authors-details'),
path('books/add', BookCreateView.as_view(), name='books-create'),
path('authors/add', AuthorCreateView.as_view(), name='authors-create'),
] ]
app_name = "bookshelf" # for proper namespacing in urls, otherwise will result in errors app_name = "bookshelf" # for proper namespacing in urls, otherwise will result in errors
\ 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