Commit d5a8f210 authored by Brendan Fausto's avatar Brendan Fausto

fixed more url errors for bookshelf homepage

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