Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
D
danimuncal_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
Izaac Daniel B. Muncal
danimuncal_reading
Commits
59fbcf30
Commit
59fbcf30
authored
Mar 28, 2023
by
Izaac Daniel B. Muncal
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Initialized views and urls for the .html files
parent
747fb85a
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
29 additions
and
5 deletions
+29
-5
urls.py
danimuncal_reading/bookshelf/urls.py
+6
-2
views.py
danimuncal_reading/bookshelf/views.py
+23
-3
No files found.
danimuncal_reading/bookshelf/urls.py
View file @
59fbcf30
from
django.urls
import
path
from
.views
import
index
from
.views
import
home_view
,
BooksView
,
BooksDetailView
,
AuthorView
,
AuthorDetailView
urlpatterns
=
[
path
(
''
,
index
,
name
=
'index'
),
path
(
''
,
home_view
,
name
=
'home'
),
path
(
'books'
,
BooksView
.
as_view
(),
name
=
'books'
),
path
(
'books/<int:pk>/details/'
,
BooksDetailView
.
as_view
(),
name
=
'book-details'
),
path
(
'author'
,
AuthorView
.
as_view
(),
name
=
'author'
),
path
(
'author/<int:pk>/details/'
,
AuthorDetailView
.
as_view
(),
name
=
'author-details'
),
]
# This might be needed depending on your Django version
app_name
=
"bookshelf"
\ No newline at end of file
danimuncal_reading/bookshelf/views.py
View file @
59fbcf30
from
django.shortcuts
import
render
from
django.views
import
View
from
django.http
import
HttpResponse
def
index
(
request
):
return
HttpResponse
(
'Hello World! This came from the index view'
)
def
home_view
(
request
):
return
render
(
request
,
'bookshelf/home.html'
,
{})
class
HomeView
(
View
):
def
get
(
self
,
request
):
return
render
(
request
,
'bookshelf/home.html'
,
{})
class
BooksView
(
View
):
def
get
(
self
,
request
):
return
render
(
request
,
'bookshelf/books.html'
,
{})
class
BooksDetailView
(
View
):
def
get
(
self
,
request
):
return
render
(
request
,
'bookshelf/books_detail.html'
,
{})
class
AuthorView
(
View
):
def
get
(
self
,
request
):
return
render
(
request
,
'bookshelf/author.html'
,
{})
class
AuthorDetailView
(
View
):
def
get
(
self
,
request
):
return
render
(
request
,
'bookshelf/author_details.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