CSD 4523
Python II
Semester
Assignment 5
Go to [Link] then download and install the Django Web framework
(and SQLite if you are not using a Windows-based PC, because it comes for free with
Python 2.5+ for Windows).
a) Execute
‘[Link] startproject helloworld’ to start your project, and then
‘cd helloworld; python ./[Link] startapp hello’ to start your app. (2
marks).
b) Edit helloworld/hello/[Link] to include this code (2 marks).:
from [Link] import HttpResponse
def index(request):
return HttpResponse('Hello world!')
c) In helloworld/[Link], add 'hello', to the INSTALLED_APPS variable (in any
position of the tuple) (2 marks)..
d) In helloworld/[Link], replace the commented-out line (2 marks).:
# (r'helloworld/', include('[Link]')),
with this (uncommented) line:
# (r'^$', '[Link]'),
e) Execute ‘python ./[Link] runserver’ and visit [Link] to confirm that
your code works and “Hello world!” does show up on your browser. Change the output
to something other than “Hello world!” (2 marks)..
Provide screenshots for each task.
©2022 LAMBTON COLLEGE IN TORONTO