Commit 969e248f authored by Trisha Angel Millena's avatar Trisha Angel Millena

Created Homepage: made home.html and edited urls.py under bookself

parent 08b98b31
{% extends 'base.html' %}
{% load static %}
{% block title %}My Favorite Books and Authors{% endblock %}
{% block content %}
<h1>Welcome to Trisha's Database of Favorite Books and Authors!</h1>
<p>The genres I enjoy reading are a mix of Romance and Mystery. I try to explore works of different authors most of the time.</p>
<a href = '/bookshelf/books/'>Books</a>
<a href = '/bookshelf/authors/'>Authors</a>
{% endblock %}
from django.urls import path from django.urls import path
from .views import index from . import views
urlpatterns = [ urlpatterns = [
path('', index, name = 'index'), path('home/', views.home, name = 'home'),
] ]
app_name = "bookshelf" app_name = "bookshelf"
\ No newline at end of file
from django.http import HttpResponse from django.http import HttpResponse
from django.shortcuts import render
# Create your views here. # Create your views here.
def index(request): def home(request):
return HttpResponse('') return render(request, 'bookshelf/home.html')
\ No newline at end of file \ No newline at end of file
...@@ -59,7 +59,7 @@ ROOT_URLCONF = 'trishamillena_reading.urls' ...@@ -59,7 +59,7 @@ ROOT_URLCONF = 'trishamillena_reading.urls'
TEMPLATES = [ TEMPLATES = [
{ {
'BACKEND': 'django.template.backends.django.DjangoTemplates', 'BACKEND': 'django.template.backends.django.DjangoTemplates',
'DIRS': [], 'DIRS': [os.path.join(BASE_DIR, 'templates')],
'APP_DIRS': True, 'APP_DIRS': True,
'OPTIONS': { 'OPTIONS': {
'context_processors': [ 'context_processors': [
...@@ -123,6 +123,7 @@ USE_TZ = True ...@@ -123,6 +123,7 @@ USE_TZ = True
# https://docs.djangoproject.com/en/3.2/howto/static-files/ # https://docs.djangoproject.com/en/3.2/howto/static-files/
STATIC_URL = '/static/' STATIC_URL = '/static/'
STATICFILES_DIRS = [os.path.join(BASE_DIR, 'static')]
# Default primary key field type # Default primary key field type
# https://docs.djangoproject.com/en/3.2/ref/settings/#default-auto-field # https://docs.djangoproject.com/en/3.2/ref/settings/#default-auto-field
......
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