Commit 515e23f9 authored by Trisha Angel Millena's avatar Trisha Angel Millena

Edited urls.py: Added path(authors/add/), Edited add-author.html

parent a71efdd2
...@@ -5,16 +5,8 @@ ...@@ -5,16 +5,8 @@
{% block title %}Add New Author{% endblock %} {% block title %}Add New Author{% endblock %}
<form method = "POST"> <form method = "POST">
{% csrf_token % } {% csrf_token % }
{{ form.as_p }}
{% for field in form%}
{% endform %}
<input type = "submit" value = "Add Author" /> <input type = "submit" value = "Add Author" />
</form> </form>
{% block content %}
{% endblock %} {% endblock %}
from django.urls import path from django.urls import path
from .views import (home, BooksListView, BooksDetailView, AuthorListView, AuthorDetailView, BooksCreateView) from .views import (home, BooksListView, BooksDetailView, AuthorListView, AuthorDetailView, BooksCreateView, AuthorCreateView)
urlpatterns = [ urlpatterns = [
path('home/', home, name = 'home'), path('home/', home, name = 'home'),
...@@ -9,6 +9,7 @@ urlpatterns = [ ...@@ -9,6 +9,7 @@ urlpatterns = [
path('authors/<int:pk>/details', AuthorDetailView.as_view(), name = 'author-details'), path('authors/<int:pk>/details', AuthorDetailView.as_view(), name = 'author-details'),
path('books/add/', BooksCreateView.as_view(), name = "add-book"), path('books/add/', BooksCreateView.as_view(), name = "add-book"),
path('authors/add/', AuthorCreateView.as_view(), name = "add-author"),
] ]
app_name = "bookshelf" app_name = "bookshelf"
\ 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