Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
CSCI40Lab1
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
Xavier Calabia
CSCI40Lab1
Commits
d8fb8c70
Commit
d8fb8c70
authored
Mar 07, 2020
by
Xavier Calabia
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
root page now redirects to /heroes (which still contains nothing)
urls added for the separate heroes
parent
a1d7df9b
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
31 additions
and
8 deletions
+31
-8
jester.png
heroes/templates/hero/jester.png
+0
-0
heroes.html
heroes/templates/heroes.html
+9
-2
tests.py
heroes/tests.py
+1
-1
urls.py
heroes/urls.py
+6
-2
views.py
heroes/views.py
+15
-3
No files found.
jester.png
→
heroes/templates/hero/
jester.png
View file @
d8fb8c70
File moved
heroes/templates/heroes.html
View file @
d8fb8c70
<html>
<
<
title
>
The Will of the Wisps Wiki
</title>
<!DOCTYPE html>
<html
lang=
"en"
dir=
"ltr"
>
<head>
<meta
charset=
"utf-8"
>
<title>
The Will of the Wisps Wiki
</title>
</head>
<body>
</body>
</html>
heroes/tests.py
View file @
d8fb8c70
...
...
@@ -3,6 +3,6 @@
from
django.test
import
TestCase
class
HomePageTest
(
TestCase
):
def
test_
uses_heroe
s_template
(
self
):
def
test_
redirects_to_hero
s_template
(
self
):
response
=
self
.
client
.
get
(
'/'
)
self
.
assertTemplateUsed
(
response
,
'heroes.html'
)
heroes/urls.py
View file @
d8fb8c70
from
django.conf.urls
import
url
from
.
views
import
heros_page
from
.
import
views
urlpatterns
=
[
url
(
r'$'
,
heros_page
,
name
=
'heros_page'
),
url
(
r'heroes'
,
views
.
heroes_page
,
name
=
'heroes_page'
),
url
(
r'\A\Z'
,
views
.
redirect_to_heroes_page
,
name
=
'redirect_to_heroes_page'
),
url
(
'hero/cloud'
,
views
.
cloud_info_page
,
name
=
'cloud_info_page'
),
url
(
'hero/sunflowey'
,
views
.
sunflowey_info_page
,
name
=
'sunflowey_info_page'
),
url
(
'hero/jester'
,
views
.
jester_info_page
,
name
=
'jester_info_page'
),
]
heroes/views.py
View file @
d8fb8c70
# Create your views here.
from
django.shortcuts
import
render
# Create your views here.
from
django.shortcuts
import
render
,
redirect
def
heros_page
(
request
):
def
hero
e
s_page
(
request
):
return
render
(
request
,
'heroes.html'
)
def
redirect_to_heroes_page
(
request
):
return
redirect
(
'/heroes'
)
def
cloud_info_page
(
request
):
return
render
(
request
,
'hero/detail_cloud.html'
)
def
sunflowey_info_page
(
request
):
return
render
(
request
,
'hero/detail_sunflowey.html'
)
def
jester_info_page
(
request
):
return
render
(
request
,
'hero/detail_jester.html'
)
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