Commit d5a8f210 authored by Brendan Fausto's avatar Brendan Fausto

fixed more url errors for bookshelf homepage

parent 85892caf
......@@ -39,6 +39,3 @@ class Authors(models.Model):
def get_absolute_url(self):
return reverse ('bookshelf:authors-details', kwargs = {'pk': self.pk})
\ No newline at end of file
def get_absolute_url(self):
return reverse('bookshelf:books-details', kwargs={'pk': self.pk})
\ No newline at end of file
{{% extends 'base.html' %}
{% extends 'base.html' %}
{% block title %}
......
# about/urls.py
from django.urls import path
from .views import home_view
from .views import (home_view)
urlpatterns = [
path('home', home_view, name='index'),
path('home', home_view, name='index')
]
app_name = "bookshelf" # for proper namespacing in urls, otherwise will result in errors
\ No newline at end of file
......@@ -7,8 +7,7 @@ from .models import Books, Authors
def home_view(request):
return render(request, 'bookshelf/homepage.html', {
'page_title': 'Books and Authors'
'page_title': "Books and Authors"
})
# Create your views here.
No preview for this file type
......@@ -60,7 +60,7 @@ ROOT_URLCONF = 'reading.urls'
TEMPLATES = [
{
'BACKEND': 'django.template.backends.django.DjangoTemplates',
'DIRS': [],
'DIRS': [os.path.join(BASE_DIR, 'template')],
'APP_DIRS': True,
'OPTIONS': {
'context_processors': [
......
......@@ -17,6 +17,7 @@ from django.contrib import admin
from django.urls import include, path
urlpatterns = [
path('admin/', admin.site.urls),
path('bookshelf/', include('bookshelf.urls', namespace="bookshelf")),
path('admin/', admin.site.urls),
]
......@@ -11,7 +11,7 @@
{% endblock %}
</div>
<div id = "content">
{% block scripts %}
{% block content %}
{% endblock %}
</div>
</body>
......
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