Commit 22db9d6c authored by Brendan Fausto's avatar Brendan Fausto

fixed naming error on template and typo in urls

parent eba77f89
...@@ -7,5 +7,8 @@ ...@@ -7,5 +7,8 @@
{% block content %} {% block content %}
Test blurb about books and their genres, as well as the authors behind the books here <p>Test blurb about books and their genres, as well as the authors behind the books here</p>
<br>
<a href = "http://127.0.0.1:8000/bookshelf/books">Books</a>
<a href = "http://127.0.0.1:8000/bookshelf/authors">Authors</a>
{% endblock %} {% endblock %}
\ No newline at end of file
...@@ -4,7 +4,7 @@ from django.urls import path ...@@ -4,7 +4,7 @@ from django.urls import path
from .views import index, HomePageView from .views import index, HomePageView
urlpatterns = [ urlpatterns = [
path('home', HomePageView.as_view(), name='index'), path('home', HomepageView, name='index'),
] ]
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
...@@ -6,6 +6,9 @@ from django.views.generic.list import ListView ...@@ -6,6 +6,9 @@ from django.views.generic.list import ListView
from .models import Books, Authors from .models import Books, Authors
class HomepageView(request): class HomepageView(request):
return render(request, 'homepage.html', {'page_title': 'Books and Authors'}) return render(request, 'bookshelf/homepage.html', {
'page_title': 'Books and Authors'
})
# Create your views here. # Create your views here.
...@@ -14,8 +14,9 @@ Including another URLconf ...@@ -14,8 +14,9 @@ Including another URLconf
2. Add a URL to urlpatterns: path('blog/', include('blog.urls')) 2. Add a URL to urlpatterns: path('blog/', include('blog.urls'))
""" """
from django.contrib import admin from django.contrib import admin
from django.urls import path from django.urls import include, path
urlpatterns = [ urlpatterns = [
path('admin/', admin.site.urls), path('admin/', admin.site.urls),
path('bookshelf/', include('bookshelf.urls', namespace="bookshelf")),
] ]
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