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

Django

Django is a Python web framework that simplifies web application development by providing ready-made components for user authentication, management panels, and file uploads. It is popular for its ease of database switching, built-in admin interface, scalability, and extensive package availability, being used by notable sites like Instagram and National Geographic. The document also outlines installation steps, environment setup, and commands to start a Django project and server.
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views

Django

Django is a Python web framework that simplifies web application development by providing ready-made components for user authentication, management panels, and file uploads. It is popular for its ease of database switching, built-in admin interface, scalability, and extensive package availability, being used by notable sites like Instagram and National Geographic. The document also outlines installation steps, environment setup, and commands to start a Django project and server.
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 14

Introduct

ion
Django is a Python-based web framework which
allows you to quickly create web application without
all of the installation or dependency problems that
you normally will find with other frameworks.
When you’re building a website, you always need a
similar set of components: a way to handle user
authentication (signing up, signing in, signing out), a
management panel for your website, forms, a way to
upload files, etc. Django gives you ready-made
components to use.
Why Django?
1.It’s very easy to switch database in Django
framework.
2.It has built-in admin interface which makes
easy to work with it.
3.Django is fully functional framework that
requires nothing else.
4.It has thousands of additional packages
available.
5.It is very scalable.
Popularity of Django
Django is used in many popular sites like as:
Disqus, Instagram, Knight Foundation, MacArthur Foundation,
Mozilla, National Geographic etc. There are more than 5k online
sites based on the Django framework. ( Source )
Sites like major Frameworks assess the
popularity of a framework by counting the number of GitHub
projects and StackOverflow questions for each platform, here
Django is in 6th position. Web frameworks often refer to
themselves as “opinionated” or “un-opinionated” based on
opinions about the right way to handle any particular task.
Django is somewhat opinionated, hence delivers the in both
worlds( opinionated & un-opinionated ).
Features of Django
Versatility of Django
Django can build almost any type of website. It can also
work with any client-side framework and can deliver
content in any format such as HTML, JSON, XML etc. Some
sites which can be built using Django are wikis, social
networks, new sites etc.
Security
Since Django framework is made for making web
development easy, it has been engineered in such a way
that it automatically do the right things to protect the
website. For example, In the Django framework instead of
Features of Django
Scalability
Django web nodes have no stored state, they scale
horizontally – just fire up more of them when you need them.
Being able to do this is the essence of good scalability. Instagram
and Disqus are two Django based products that have millions of
active users, this is taken as an example of the scalability of
Django.

Portability
All the codes of the Django framework are written
in Python, which runs on many platforms. Which leads to run
Installation of Django
Install python3 if not installed in your system ( according
to configuration of your system and OS) from here . Try to
download the latest version of python it’s python 3.11.0
this time.

Note- Installation of Django in Linux and Mac is similar,


here I am showing it in windows for Linux and mac just
open terminal in place of command prompt and go
through the following commands.
Create an environment
1st Open Python Directory in CMD using Admin Mode
Create a project folder and a djvenv folder within:
> mkdir myproject
> cd myproject
> py -3 -m venv venv
Activate the environment
Before you work on your project, activate the
corresponding environment:
> venv\Scripts\activate
Install Django- Install django by giving
following command-

pip install Django


Return to the env_site directory-
cd ..
Start a project by following command-

django-admin startproject myproject


Change directory to myproject
cd my_site
Start the server- Start the server by
typing following command in cmd-
python manage.py runserver
To check whether server is running or not go
to web browser and enter
http://127.0.0.1:8000/ as url.
Start the new app- Start the new app by
typing following command in cmd-
python manage.py startapp calc

You might also like