0% found this document useful (0 votes)
8 views7 pages

Exp 8 04

Uploaded by

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

Exp 8 04

Uploaded by

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

Vidyavardhini’s College of Engineering & Technology

K.T. MARG, VASAI ROAD (WEST)


Department of Computer Science and Engineering(Data Science)

EXPERIMENT ASSESSMENT

ACADEMIC YEAR 2024-25

Course: Skill Base Lab Course: Python Programming

Course code: CSL405

Year: SE SEM: IV
Experiment No. 8

AIM:- Creating web application using Django framework to


demonstrate functionality of user login and registration
Name:advay joshi

Roll Number: 04

Date of Performance: 17/03/2025

Date of Submission: 24/03/2025

Evaluation
Performance Indicator Max. Marks Marks Obtained
Performance 5
Understanding 5
Journal work and timely submission. 10
Total 20

Performance Indicator Exceed Expectations (EE) Meet Expectations (ME) Below Expectations (BE)
Performance 5 3 2
Understanding 5 3 2
Journal work and timely
10 8 4
submission.

Checked by

Name of Faculty​ : Mrs. Maya Varghese


Signature ​ ​ :
Date ​ ​ ​ :
Vidyavardhini’s College of Engineering & Technology
K.T. MARG, VASAI ROAD (WEST)
Department of Computer Science and Engineering(Data Science)

Experiment No. 8: Creating web application using Django framework to demonstrate


functionality of user login and registration

AIM: Creating web application using Django framework to demonstrate functionality of user
login and registration

THEORY:
Django is a high-level Python web framework that encourages rapid development and clean,
pragmatic design. Django is a back-end server side web framework. Django is free, open
source and written in Python. Django makes it easier to build web pages using Python.
It is suggested to have a dedicated virtual environment for each Django project, and one way
to manage a virtual environment is venv, which is included in Python.
The name of the virtual environment is : myworld.
Type the following in the command prompt, remember to navigate to where you want to
create your project
py-m venv myworld
This will set up a virtual environment, and create a folder named "myworld" with subfolders
and files, like this:
myworld
Include
Lib
Scripts
pyvenv.cfg
Then you have to activate the environment, by typing this command:
myworld\Scripts\activate.bat
Once the environment is activated, you will see this result in the command prompt:
(myworld) C:\Users\
Django is installed using pip, with this command:
(myworld) C:\Users\Your Name>py-m pip install Django
Once you have come up with a suitable name for your Django project, like mine:
my_tennis_club, navigate to where in the file system you want to store the code (in the virtual
Vidyavardhini’s College of Engineering & Technology
K.T. MARG, VASAI ROAD (WEST)
Department of Computer Science and Engineering(Data Science)

environment), I will navigate to the myworld folder, and run this command in the command
prompt:
django-admin startproject my_tennis_club
Django creates a my_tennis_club folder on my computer, with this content:
my_tennis_club
manage.py
my_tennis_club/
__init__.py
asgi.py
settings.py
urls.py
wsgi.py
Run the Django Project
Now that you have a Django project, you can run it, and see what it looks like in a browser.
Navigate to the /my_tennis_club folder and execute this command in the command prompt:
py manage.py runserver
Open a new browser window and type 127.0.0.1:8000 in the address bar.
An app is a web application that has a specific meaning in your project, like a home page, a
contact form, or a members database
Start by navigating to the selected location where you want to store the app, in my case the
my_tennis_club folder, and run the command below.
If the server is still running, and you are not able to write commands, press [CTRL]
[BREAK], or [CTRL] [C] to stop the server and you should be back in the virtual
environment.
py manage.py startapp members
Django views are Python functions that takes http requests and returns http response, like
HTML documents. A webpage that uses Django is full of views with different tasks and
missions. Views are usually put in a file called views.py located on your app's folder.
Find it and open it, and replace the content with this:
my_tennis_club/members/views.py:
from django.shortcuts import render
from django.http import HttpResponse
Vidyavardhini’s College of Engineering & Technology
K.T. MARG, VASAI ROAD (WEST)
Department of Computer Science and Engineering(Data Science)

def members(request):
return HttpResponse("Hello world!")
Create a file named urls.py in the same folder as the views.py file, and type this code in it:
my_tennis_club/members/urls.py:
from django.urls import path
from . import views
urlpatterns = [
path('', include('members.urls')), path('admin/', admin.site.urls), ]
If the server is not running, navigate to the /my_tennis_club folder and execute this command
in the command prompt:
py manage.py runserver
In the browser window, type 127.0.0.1:8000/members/ in the address bar.
Vidyavardhini’s College of Engineering & Technology
K.T. MARG, VASAI ROAD (WEST)
Department of Computer Science and Engineering(Data Science)

Code: Write a code to display a webpage using Django


Github URL: https://github.com/Omm13/python-

Screenshot:
Database snapshot:

Login page:
Vidyavardhini’s College of Engineering & Technology
K.T. MARG, VASAI ROAD (WEST)
Department of Computer Science and Engineering(Data Science)

Register page:

Conclusion: Identify other framework similar to django framework and describe the
advantages of django framework.
ANS :

Frameworks Similar to Django


Here are some popular alternatives to Django for Python-based web development:

●​ Flask: A minimalist micro-framework that provides flexibility and control, ideal


for smaller projects or applications requiring custom architectures127.
●​ FastAPI: Specializes in building APIs with high performance and
asynchronous capabilities, making it suitable for modern web applications1.
●​ Tornado: A Python framework focused on asynchronous networking, ideal for
real-time applications2.
●​ Web2Py: A full-stack framework for rapid development of scalable and secure
database-driven web applications2.
●​ TurboGears: Combines features of multiple frameworks, offering a modular
approach to development23.​
Other notable frameworks include Pyramid, CherryPy, Bottle, and BlueBream3.
Vidyavardhini’s College of Engineering & Technology
K.T. MARG, VASAI ROAD (WEST)
Department of Computer Science and Engineering(Data Science)

Advantages of Django Framework


Django is widely regarded as one of the top Python frameworks due to its
comprehensive features. Key advantages include:

1.​ Batteries-Included Features:


●​ Built-in tools such as authentication, caching, session management,
and database ORM simplify development146.
●​ Reduces reliance on third-party libraries, lowering development costs8.
2.​ Rapid Development:
●​ Django's Model-View-Template (MVT) architecture and DRY principle
enable faster application development with reusable components146.
3.​ Security:
●​ Protects against common vulnerabilities like SQL injection, cross-site
scripting (XSS), and clickjacking by default15.
4.​ Scalability:
●​ Supports horizontal scaling, caching mechanisms, and asynchronous
processing for efficient handling of large-scale applications18.
5.​ Ease of Use:
●​ Simplifies database operations with its ORM, eliminating the need for
complex SQL queries6.
●​ Offers excellent documentation and a large community for support5.
6.​ Flexibility:
●​ Suitable for diverse applications such as e-commerce, social media
platforms, APIs, and real-time apps8.​
While Django is highly versatile and feature-rich, it may be less suitable
for smaller projects due to its heavyweight nature and steeper learning
curve compared to lightweight frameworks like Flask13

You might also like