Commit b5dbf966 authored by KaoruSawade's avatar KaoruSawade

Edited urls to reflect requirements in the specs, edited base.html to properly...

Edited urls to reflect requirements in the specs, edited base.html to properly display a bottom navbar
parent 8588fbb3
from django.urls import path from django.urls import path
from .views import index from .views import home, books, authors
urlpatterns = [ urlpatterns = [
path('', index, name='index'), path('home/', home, name='home'),
path('books/', books, name='books'),
path('authors/', authors, name='authors'),
] ]
app_name = "bookshelf" app_name = "bookshelf"
from django.shortcuts import render from django.shortcuts import render
from django.http import HttpResponse from django.http import HttpResponse
def index(request):
return HttpResponse('test') def home(request):
\ No newline at end of file return render(request, 'bookshelf/home.html')
def books(request):
return render(request, 'bookshelf/books.html')
def authors(request):
return render(request, 'bookshelf/authors.html')
\ No newline at end of file
...@@ -17,6 +17,6 @@ from django.contrib import admin ...@@ -17,6 +17,6 @@ from django.contrib import admin
from django.urls import include, path from django.urls import include, path
urlpatterns = [ urlpatterns = [
path('bookshelf/', include('bookshelf.urls', namespace="bookshelf")), path('', include('bookshelf.urls', namespace="bookshelf")),
path('admin/', admin.site.urls), path('admin/', admin.site.urls),
] ]
<!DOCTYPE html> <!DOCTYPE html>
<html lang="en"> <html lang="en">
<head> <head>
<link rel="stylesheet" href="style.css"> <style>
<title>{% block title %}My amazing site{% endblock %}</title> .navbarList{
list-style-type: none;
margin: 0;
padding: 0;
}
.navbarItem{
display: inline;
}
</style>
<title>{% block title %}{% endblock %}</title>
{% block styles %}{% endblock %} {% block styles %}{% endblock %}
</head> </head>
<body> <body>
<div id="content"> <div id="content">
{% block content %}{% endblock %} {% block content %}{% endblock %}
</div> </div>
{% block scripts %}{% endblock %} <hr>
<navbar>
{% block navbar %}{% endblock %}
</navbar>
</body> </body>
</html> </html>
\ 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