0% found this document useful (0 votes)
32 views1 page

Python Project

Python programming project 2024

Uploaded by

queenlandsupreme
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
32 views1 page

Python Project

Python programming project 2024

Uploaded by

queenlandsupreme
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 1

CSD 4523

Python II
Semester

Assignment 5

Go to http://djangoproject.com 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
‘django-admin.py startproject helloworld’ to start your project, and then
‘cd helloworld; python ./manage.py startapp hello’ to start your app. (2
marks).

b) Edit helloworld/hello/views.py to include this code (2 marks).:

from django.http import HttpResponse


def index(request):
return HttpResponse('Hello world!')

c) In helloworld/settings.py, add 'hello', to the INSTALLED_APPS variable (in any


position of the tuple) (2 marks)..

d) In helloworld/urls.py, replace the commented-out line (2 marks).:

# (r'helloworld/', include('helloworld.foo.urls')),

with this (uncommented) line:

# (r'^$', 'hello.views.index'),

e) Execute ‘python ./manage.py runserver’ and visit http://localhost:8000 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

You might also like