Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
csci40_midterms
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
John Carlos Sanil
csci40_midterms
Commits
c30e8b9e
Commit
c30e8b9e
authored
Mar 21, 2020
by
Carlowsss
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Setup urls, tested and created home page
parent
1155bd9d
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
28 additions
and
1 deletion
+28
-1
home.html
froyo/templates/home.html
+6
-0
tests.py
froyo/tests.py
+7
-0
urls.py
froyo/urls.py
+8
-0
views.py
froyo/views.py
+5
-0
urls.py
thegoodplace/urls.py
+2
-1
No files found.
froyo/templates/home.html
0 → 100644
View file @
c30e8b9e
<html>
<head>
<title>
The Good Place FroYo Shop
</title>
</head>
<h1>
The Good Place FroYo Shop
</h1>
</html>
froyo/tests.py
View file @
c30e8b9e
from
django.test
import
TestCase
from
django.test
import
TestCase
# Create your tests here.
# Create your tests here.
class
HomePageTest
(
TestCase
):
def
test_home_page_returns_correct_html
(
self
):
response
=
self
.
client
.
get
(
'/'
)
self
.
assertTemplateUsed
(
response
,
'home.html'
)
froyo/urls.py
0 → 100644
View file @
c30e8b9e
from
django.conf.urls
import
url
from
.views
import
HomePageView
urlpatterns
=
[
url
(
r'^$'
,
HomePageView
.
as_view
(),
name
=
'home'
),
]
\ No newline at end of file
froyo/views.py
View file @
c30e8b9e
from
django.shortcuts
import
render
from
django.shortcuts
import
render
from
django.views.generic.base
import
TemplateView
# Create your views here.
# Create your views here.
class
HomePageView
(
TemplateView
):
template_name
=
"home.html"
\ No newline at end of file
thegoodplace/urls.py
View file @
c30e8b9e
...
@@ -13,9 +13,10 @@ Including another URLconf
...
@@ -13,9 +13,10 @@ Including another URLconf
1. Import the include() function: from django.conf.urls import url, include
1. Import the include() function: from django.conf.urls import url, include
2. Add a URL to urlpatterns: url(r'^blog/', include('blog.urls'))
2. Add a URL to urlpatterns: url(r'^blog/', include('blog.urls'))
"""
"""
from
django.conf.urls
import
url
from
django.conf.urls
import
include
,
url
from
django.contrib
import
admin
from
django.contrib
import
admin
urlpatterns
=
[
urlpatterns
=
[
url
(
r'^admin/'
,
admin
.
site
.
urls
),
url
(
r'^admin/'
,
admin
.
site
.
urls
),
url
(
r''
,
include
(
'froyo.urls'
)),
]
]
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