Commit 2ad2240f authored by Ysobel Vera's avatar Ysobel Vera

Created templates folder and created base.html, home.html, and books.html

+base, home, and books html files were created and put into the address ysovera_reading/ysovera_reading/bookshelf/templates/bookshelf
-The files still need to be edited but since I am unsure of how to properly do so, I will create a branch to test out some code.
parent 428e58bf
from django.db import models
from django.urls import reverse
class Author(models.Model):
first_name = models.CharField(max_length=100)
......@@ -21,3 +22,5 @@ class Books(models.Model):
def __str__(self):
return '{} ({}) by {}'.format(self.title, self.year_published, self.author)
<!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>
\ No newline at end of file
{% comment %}
{% extends 'base.html' %}
{% load static %}
{% block title %}My Favorite Books{% endblock %}
{% block body %}
<h1>Yso’s Favorite Books:</h1>
<ul>
{% for book in Books.objects.all() %}
<li>
<a href="{{ book.get_absolute_url }}">
{{ book.title }}
</a>
</li>
{% endfor %}
</ul>
{% endblock %}
{% endcomment %}
\ No newline at end of file
{% comment %}
{% extends 'base.html' %}
{% load static %}
{% block title %}My Favorite Books & Authors{% endblock %}
{% block content %}
<h1>Welcome to Yso’s Database of Favorite Books and Authors</h1>
<p>Reading is one of my favorite hobbies to do in my free time. I especially love fantasy, historical fiction, <br>mystery, and coming-of-age books that deal with many characters and their relationships to one another. The <br> authors that appeal to me tend to have a dialogue-heavy writing style or at least do not make descriptions and <br>exposition the main focus of the writing. I like authors that are able to convey situations and relationships <br>through the characters’ actions and dialogue without having to tell readers what to think, rather there is focus <br>on showing readers what happens. </p>
{% endblock %}
{% endcomment %}
from django.shortcuts import render
from django.http import HttpResponse
#from django.http import HttpResponse
def index(request):
return HttpResponse('Hello World! This came from the index view')
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