Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
J
janang_reading
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jan Ericsson Ong Ang
janang_reading
Commits
1b9b05cd
Commit
1b9b05cd
authored
Mar 29, 2023
by
Jan Ericsson Ong Ang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
edited urls.py and views.py
parent
b6d8c359
Changes
13
Hide whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
43 additions
and
32 deletions
+43
-32
urls.cpython-310.pyc
janang_reading/bookshelf/__pycache__/urls.cpython-310.pyc
+0
-0
views.cpython-310.pyc
janang_reading/bookshelf/__pycache__/views.cpython-310.pyc
+0
-0
author_details.html
...reading/bookshelf/templates/bookshelf/author_details.html
+8
-7
authors.html
janang_reading/bookshelf/templates/bookshelf/authors.html
+7
-5
books.html
janang_reading/bookshelf/templates/bookshelf/books.html
+7
-5
home.html
janang_reading/bookshelf/templates/bookshelf/home.html
+7
-4
urls.py
janang_reading/bookshelf/urls.py
+5
-3
views.py
janang_reading/bookshelf/views.py
+5
-3
settings.cpython-310.pyc
...ading/janang_reading/__pycache__/settings.cpython-310.pyc
+0
-0
urls.cpython-310.pyc
...g_reading/janang_reading/__pycache__/urls.cpython-310.pyc
+0
-0
settings.py
janang_reading/janang_reading/settings.py
+2
-3
urls.py
janang_reading/janang_reading/urls.py
+1
-1
base.html
janang_reading/templates/base.html
+1
-1
No files found.
janang_reading/bookshelf/__pycache__/urls.cpython-310.pyc
View file @
1b9b05cd
No preview for this file type
janang_reading/bookshelf/__pycache__/views.cpython-310.pyc
View file @
1b9b05cd
No preview for this file type
janang_reading/bookshelf/templates/bookshelf/author_details.html
View file @
1b9b05cd
{% extends 'base.html' %}
{% extends 'base.html' %}
{% load static %}
{% block title %}{{ author.first_name }} {{ author.last_name }}{% endblock %}
{% block header %}{{ author.first_name }} {{ author.last_name }}{% endblock %}
{% block content %}
{% block header %}
<h1>
{{ author.first_name }} {{ author.last_name }}
</h1>
{% endblock %}
<p>
{{ author.age }}
</p>
<p>
{{ author.nationality }}
</p>
<p>
{{ author.bio }}
</p>
<p>
Books by {{ author.first_name }} {{ author.last_name }} I love
</p>
<a
href=
"/books
/1/details
"
>
Home
</a><br>
<a
href=
"/books
helf/books/1/details/
"
>
Home
</a><br>
<a
href=
"/
homepage
/"
>
Home
</a>
<a
href=
"/books/"
>
Books
</a>
<a
href=
"/
authors
/"
>
Authors
</a>
<a
href=
"/
bookshelf
/"
>
Home
</a>
<a
href=
"/books
helf/books
/"
>
Books
</a>
<a
href=
"/
bookshelf/author
/"
>
Authors
</a>
{% endblock %}
\ No newline at end of file
janang_reading/bookshelf/templates/bookshelf/authors.html
View file @
1b9b05cd
{% extends 'base.html' %}
{% extends 'base.html' %}
{% load static %}
{% block title %}My Favorite Authors{% endblock %}
{% block header %},{% nickname %}'s Favorite Authors:{% endblock %}
{% block content %}
{% block header %}
<h1>
{{ nickname }}'s Favorite Authors:
</h1>
{% endblock %}
<br>
{% for author in authors %}
<a
href=
"/author/{{ author.pk }}/details/"
>
{{ author.first_name }} {{ author.last_name }}
</a>
<a
href=
"/
bookshelf/
author/{{ author.pk }}/details/"
>
{{ author.first_name }} {{ author.last_name }}
</a>
{% endfor %}
<br>
<a
href=
"/
homepage
/"
>
Home
</a>
<a
href=
"/books/"
>
Books
</a>
<a
href=
"/
bookshelf
/"
>
Home
</a>
<a
href=
"/books
helf/books
/"
>
Books
</a>
{% endblock %}
\ No newline at end of file
janang_reading/bookshelf/templates/bookshelf/books.html
View file @
1b9b05cd
{% extends 'base.html' %}
{% extends 'base.html' %}
{% load static %}
{% block title %}My Favorite Books{% endblock %}
{% block header %}{% nickname %}'s Favorite Books:{% endblock %}
{% block content %}
{% block header %}
<h1>
{{ nickname }}'s Favorite Books:
</h1>
{% endblock %}
<br>
{% for book in books %}
<a
href=
"/books
/{{ book.pk }}/details/"
>
{{ book.title }}
</a>
<a
href=
"/books
helf/books/{{ book.pk }}/details/"
><p>
{{ book.title }}
</p>
</a>
{% endfor %}
<br>
<a
href=
"/
homepage
/"
>
Home
</a>
<a
href=
"/
authors
/"
>
Authors
</a>
<a
href=
"/
bookshelf
/"
>
Home
</a>
<a
href=
"/
bookshelf/author
/"
>
Authors
</a>
{% endblock %}
\ No newline at end of file
janang_reading/bookshelf/templates/bookshelf/home.html
View file @
1b9b05cd
{% extends 'base.html' %}
{% load static %}
{% block title %} My Favorite Books
&
Authors!{% endblock %}
{% block header %}Welcome to {% nickname %}'s Database of Favorite Books and Author's! {% endblock %}
{% block title %}My Favorite Books
&
Authors!{% endblock %}
{% block content %}
{% block header %}
<h1>
Welcome to {{ nickname }}'s Database of Favorite Books and Author's!
</h1>
{% endblock %}
<p>
I love fiction novels that are able to tell a story really well. A book that is able to keep me interested throughout every page is what I love!
</p>
<a
href=
"/books/"
>
Books
</a>
<a
href=
"/books
helf/books
/"
>
Books
</a>
<a
href=
"/authors/"
>
Authors
</a>
<a
href=
"/bookshelf/author/"
>
Authors
</a>
{% endblock %}
\ No newline at end of file
janang_reading/bookshelf/urls.py
View file @
1b9b05cd
...
...
@@ -6,7 +6,9 @@ from .views import HomeView, AuthorView, AuthorDetailView, BooksView, BookDetail
urlpatterns
=
[
path
(
''
,
HomeView
.
as_view
(),
name
=
'home'
),
path
(
'author/'
,
AuthorView
.
as_view
(),
name
=
'author'
),
path
(
'author/<int:pk>/'
,
AuthorDetailView
.
as_view
(),
name
=
'author-detail'
),
path
(
'author/<int:pk>/
details/
'
,
AuthorDetailView
.
as_view
(),
name
=
'author-detail'
),
path
(
'books/'
,
BooksView
.
as_view
(),
name
=
'books'
),
path
(
'books/<int:pk>/'
,
BookDetailView
.
as_view
(),
name
=
'books-detail'
),
]
\ No newline at end of file
path
(
'books/<int:pk>/details/'
,
BookDetailView
.
as_view
(),
name
=
'books-detail'
),
]
app_name
=
'bookshelf'
\ No newline at end of file
janang_reading/bookshelf/views.py
View file @
1b9b05cd
...
...
@@ -8,11 +8,12 @@ from .models import Author, Books
class
HomeView
(
View
):
def
get
(
self
,
request
):
return
render
(
request
,
'bookshelf/
templates/bookshelf/
home.html'
,
{
'nickname'
:
'Jan'
})
return
render
(
request
,
'bookshelf/home.html'
,
{
'nickname'
:
'Jan'
})
class
AuthorView
(
ListView
):
model
=
Author
template_name
=
'bookshelf/templates/bookshelf/author.html'
def
get
(
self
,
request
):
return
render
(
request
,
'bookshelf/author.html'
,
{
'nickname'
:
'Jan'
})
class
AuthorDetailView
(
DetailView
):
model
=
Author
...
...
@@ -20,7 +21,8 @@ class AuthorDetailView(DetailView):
class
BooksView
(
ListView
):
model
=
Books
template_name
=
'bookshelf/books.html'
def
get
(
self
,
request
):
return
render
(
request
,
'bookshelf/books.html'
,
{
'nickname'
:
'Jan'
})
class
BookDetailView
(
DetailView
):
model
=
Books
...
...
janang_reading/janang_reading/__pycache__/settings.cpython-310.pyc
View file @
1b9b05cd
No preview for this file type
janang_reading/janang_reading/__pycache__/urls.cpython-310.pyc
View file @
1b9b05cd
No preview for this file type
janang_reading/janang_reading/settings.py
View file @
1b9b05cd
...
...
@@ -56,7 +56,7 @@ ROOT_URLCONF = 'janang_reading.urls'
TEMPLATES
=
[
{
'BACKEND'
:
'django.template.backends.django.DjangoTemplates'
,
'DIRS'
:
[],
'DIRS'
:
[
os
.
path
.
join
(
BASE_DIR
,
'templates'
)
],
'APP_DIRS'
:
True
,
'OPTIONS'
:
{
'context_processors'
:
[
...
...
@@ -117,8 +117,7 @@ USE_TZ = True
# Static files (CSS, JavaScript, Images)
# https://docs.djangoproject.com/en/4.1/howto/static-files/
STATIC_URL
=
'/templates/'
STATICFILES_DIRS
=
[
os
.
path
.
join
(
BASE_DIR
,
'templates'
)]
STATIC_URL
=
'/static/'
# Default primary key field type
# https://docs.djangoproject.com/en/4.1/ref/settings/#default-auto-field
...
...
janang_reading/janang_reading/urls.py
View file @
1b9b05cd
...
...
@@ -18,5 +18,5 @@ from django.urls import path, include
urlpatterns
=
[
path
(
'admin/'
,
admin
.
site
.
urls
),
path
(
"bookshelf/"
,
include
(
"bookshelf.urls"
)),
path
(
"bookshelf/"
,
include
(
"bookshelf.urls"
,
namespace
=
'bookshelf'
)),
]
janang_reading/templates/base.html
View file @
1b9b05cd
...
...
@@ -9,6 +9,6 @@
<div
id=
"contetnt"
>
{% block content %}{% endblock %}
</div>
{block scripts %}{% endblock %}
{
%
block scripts %}{% endblock %}
</body>
</html>
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment