Commit f2fbcbee authored by Washington99's avatar Washington99

Creation of base and home templates

Created the base template for project wide use and a function based home_view for homepage.
parent 9a596d3d
# Default ignored files
/shelf/
/workspace.xml
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectRootManager" version="2" languageLevel="JDK_17" project-jdk-name="17" project-jdk-type="JavaSDK">
<output url="file://$PROJECT_DIR$/out" />
</component>
</project>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/.idea/thrisraotraot_reading.iml" filepath="$PROJECT_DIR$/.idea/thrisraotraot_reading.iml" />
</modules>
</component>
</project>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="RunConfigurationProducerService">
<option name="ignoredProducers">
<set>
<option value="com.android.tools.idea.compose.preview.runconfiguration.ComposePreviewRunConfigurationProducer" />
</set>
</option>
</component>
</project>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<module type="JAVA_MODULE" version="4">
<component name="NewModuleRootManager" inherit-compiler-output="true">
<exclude-output />
<content url="file://$MODULE_DIR$" />
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="" vcs="Git" />
</component>
</project>
\ No newline at end of file
from django.urls import path
from .views import index
from .views import home_view
urlpatterns = [
path('', index, name='index'),
path('home/', home_view, name='home_view'),
]
app_name = "bookshelf"
......
from django.shortcuts import render
from django.http import HttpResponse
# Create your views here.
def index(request):
return HttpResponse("Test output")
def home_view(request):
return render(request, 'home.html')
<!-- project/template/base.html -->
<!DOCTYPE html>
<html lang="en">
<head>
<link rel="stylesheet" href="style.css">
<title>{% block title %}My amazing site{% endblock %}</title>
{% block styles %}{% endblock %}
</head>
<body>
<div id="content">
{% block content %}{% endblock %}
</div>
{% block scripts %}{% endblock %}
</body>
</html>
{% extends 'base.html' %}
{% load static %}
{% block title %}My Favorite Books & Authors{% endblock %}
{% block content %}
<h2>Welcome to Thris' Database of Favorite Books and Authors</h2>
<div>
Hi, My name is Thris. I like reading mystery (or "smart") and
fantasy books. I'm also very big into action type stories so
most of my favorite books have some form of violent or physical
theme. However, I sometimes read some love stories just for my
heart. I don't really have any preference for any particular
type of author except for those that simply writes my preferred
type of books. :>
</div>
<a href="">Books</a>
<a href="">Authors</a>
{% endblock %}
\ No newline at end of file
......@@ -58,7 +58,7 @@ ROOT_URLCONF = 'thrisraotraot_reading.urls'
TEMPLATES = [
{
'BACKEND': 'django.template.backends.django.DjangoTemplates',
'DIRS': [],
'DIRS': [os.path.join(BASE_DIR, 'templates')],
'APP_DIRS': True,
'OPTIONS': {
'context_processors': [
......
......@@ -18,5 +18,5 @@ from django.urls import path, include
urlpatterns = [
path('admin/', admin.site.urls),
path('bookshelf/', include('bookshelf.urls', namespace = 'bookshelf'))
path('', 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