Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
lopez-django-lab-1
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
Jay Lopez
lopez-django-lab-1
Commits
c845fe22
Commit
c845fe22
authored
Mar 07, 2020
by
Jay Lopez
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
finished loading of homepage, begin dealing with detail pages
parent
b517844a
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
30 additions
and
4 deletions
+30
-4
fxntest.py
fxntest.py
+2
-1
urls.cpython-37.pyc
heroes/__pycache__/urls.cpython-37.pyc
+0
-0
views.cpython-37.pyc
heroes/__pycache__/views.cpython-37.pyc
+0
-0
index.html
heroes/templates/index.html
+10
-0
urls.py
heroes/urls.py
+4
-1
views.py
heroes/views.py
+14
-2
No files found.
fxntest.py
View file @
c845fe22
...
@@ -13,7 +13,7 @@ class NewVisitorTest(unittest.TestCase):
...
@@ -13,7 +13,7 @@ class NewVisitorTest(unittest.TestCase):
def
test_can_display_a_heroes_list_and_more_information_per_hero
(
self
):
def
test_can_display_a_heroes_list_and_more_information_per_hero
(
self
):
# Widget has heard about a new wiki app for the game called The Will of the Wisps.
# Widget has heard about a new wiki app for the game called The Will of the Wisps.
# She goes to check out its homepage
# She goes to check out its homepage
self
.
browser
.
get
(
'http
s
://localhost:8000/heroes'
)
self
.
browser
.
get
(
'http://localhost:8000/heroes'
)
# She notices the page title and header mention
# She notices the page title and header mention
# 'The Will of the Wisps Wiki'
# 'The Will of the Wisps Wiki'
...
@@ -42,5 +42,6 @@ class NewVisitorTest(unittest.TestCase):
...
@@ -42,5 +42,6 @@ class NewVisitorTest(unittest.TestCase):
self
.
fail
(
'Finish the test!'
)
self
.
fail
(
'Finish the test!'
)
if
__name__
==
'__main__'
:
if
__name__
==
'__main__'
:
unittest
.
main
(
warnings
=
'ignore'
)
unittest
.
main
(
warnings
=
'ignore'
)
\ No newline at end of file
heroes/__pycache__/urls.cpython-37.pyc
0 → 100644
View file @
c845fe22
File added
heroes/__pycache__/views.cpython-37.pyc
0 → 100644
View file @
c845fe22
File added
heroes/templates/index.html
0 → 100644
View file @
c845fe22
<html>
<title>
The Will of the Wisps Wiki
</title>
<h1>
Will of the Wisps
</h1>
<h4>
Heroes
</h4>
<ul>
<li><a
href=
'/hero/cloud/'
>
Cloud (600 HP, 57 ATK)
</a></li>
<li><a
href=
'/hero/jester/'
>
Jester (660 HP, 64 ATK)
</a></li>
<li><a
href=
'/hero/sunflowey/'
>
Sunflowey (650 HP, 43 ATK)
</a></li>
</ul>
</html>
\ No newline at end of file
heroes/urls.py
View file @
c845fe22
...
@@ -2,5 +2,8 @@ from django.conf.urls import url
...
@@ -2,5 +2,8 @@ from django.conf.urls import url
from
.views
import
*
from
.views
import
*
urlpatterns
=
[
urlpatterns
=
[
url
(
r'^heroes$'
,
HomeView
.
as_view
(),
name
=
'index'
),
url
(
r'^hero/cloud$'
,
CloudView
.
as_view
()),
url
(
r'^hero/sunflowey$'
,
SunfloweyView
.
as_view
()),
url
(
r'^hero/jester$'
,
JesterView
.
as_view
())
]
]
\ No newline at end of file
heroes/views.py
View file @
c845fe22
from
django.shortcuts
import
render
from
django.shortcuts
import
render
from
django.generic.base
import
TemplateView
from
django.
views.
generic.base
import
TemplateView
# Create your views here.
# Create your views here.
class
HomeView
(
TemplateView
):
class
HomeView
(
TemplateView
):
template_name
=
'home.html'
template_name
=
'index.html'
\ No newline at end of file
class
CloudView
(
TemplateView
):
template_name
=
'detail_cloud.html'
class
JesterView
(
TemplateView
):
template_name
=
'detail_jester.html'
class
SunfloweyView
(
TemplateView
):
template_name
=
'detail_sunflowey.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