0% found this document useful (0 votes)
103 views

Django PPT

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

Django PPT

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

INTRODUCTION TO DJANGO

NAME- SURAJ PANDEY


B.TECH CSE SECTION-D
UNIVERSITY ROLL_NO-2161326

This Photo by Unknown author is licensed under CC BY-SA-NC.


Django is a high-level Python framework. It is free and
open-source, written in Python itself, and follows the
model-view-template architectural pattern.

We can use it to develop quality web applications faster


Introduction and easier. Since developing for the web needs a set of
similar components, you can use a framework.

This way, you don't have to reinvent the wheel. These


tasks include authentication, forms, uploading files,
management panels, and so.
Features

Rapid
Secure Scalable Fully Loaded
Development

Vast and
Versatile Open Source Supported Less Cost
Community
Project Architecture

 The Model is the part of the web-app which acts as a


mediator between the website interface and the
database.

 View is actually the User Interface of the web-application


and contains the parts like HTML, CSS and other frontend
technologies.

 The main task of the controller is to select a view component


according to the user interaction and also applying the
model component.
MVT Architecture

 Models:- Just like the Model in MVC, here as well it


has the same functionality of providing the interface
for the data stored in the database.
 Views:- In Django, Views act as a link between the
Model data and the Templates. It sees the user
request, retrieves appropriate data from the database,
then renders back the template along with retrieved
data.
 Templates :- Django uses templates in its framework.
Templates are responsible for the entire User
Interface completely.
Control Flow
 The user sends a URL request for a
resource to Django.
 Django framework then searches
for the URL resource.
 If the URL path links up to a View,
then that particular View is called.
 The View will then interact with the
Model and retrieve the appropriate
data from the database.
 The View then renders back an
appropriate template along with the
retrieved data to the user
Django provides a ready-to-use user interface for administrative
activities.
 We need some modules are imported in the INSTALLED
APPS and MIDDLEWARE CLASSES tuples of the
myproject/settings.py file.
Create SuperUser for the Admin access
python manage.py createsuperuser
Admin Interface
from django.conf.urls import patterns, include, url
from django.contrib import admin
admin.autodiscover ()urlpatterns = patterns ('', url(r'^admin/’,
include (admin.site.urls)),)
 URL Routing in Django allows you to declare all the
routes (links) common to your web application by
mapping a URL to the code (view) that creates a web
page


URL Routing urls.py
from django.contrib import admin
from django.urls import path
urlpatterns = [
path('admin/', admin.site.urls),
]
Pros
Excellent for big project

Easy database management

Time effective

Secure and up-to-date

Backward-compatible

Magical ORM

Endless resources

Compatible with DevOps


Not suitable for small Projects

Heavy and You probably won’t utilize the whole framework

Monolithic one

All components get deployed together


Cons Cannot Handle Multiple Requests

Tightly Coupled Components

No Conventions

Slower
Certificate
References

https://docs.djangoproject.com/en/4.2/

https://www.w3schools.com/django/

https://realpython.com/tutorials/django/
Thank You!

You might also like