Django Tutorials
What is DJango?
Django, an open-source framework, is a popular high-level web framework in Python which supports rapid web development and design.
Some of its features are-
Django helps developers avoid various common security mistakes.
With this framework, developers can take web applications from concept to launch within hours.
The user authentication system of this framework provides a secure way to manage user accounts and passwords.
Django is a web application framework written in Python programming language. It is based on MVT (Model View Template) design pattern.
Django is a Python-based web framework that allows you to quickly create efficient web applications. It is also called batteries included framework because Django provides built-in features for everything including Django Admin Interface, default database – SQLlite3, etc. 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 and that too for rapid development.
History
Django was design and developed by Lawrence journal world in 2003 and publicly released under BSD license in July 2005. Currently, DSF (Django Software Foundation) maintains its development and release cycle. Django was released on 21, July 2005. Its current stable version is 2.0.3 which was released on 6 March, 2018.
Features of Django
File name : index.py
Rapid Development
Secure
Scalable
Fully loaded
Versatile
Open Source
Vast and Supported Community
Why Django Framework used?
Excellent documentation and high scalability.
Used by Top MNCs and Companies, such as Instagram, Disqus, Spotify, Youtube, Bitbucket, Dropbox, etc. and the list is never-ending.
Easiest Framework to learn, rapid development and Batteries fully included.
The last but not least reason to learn Django is Python, Python has huge library and features such as Web Scrapping, Machine Learning, Image Processing, Scientific Computing, etc. One can integrate it all this with web application and do lots and lots of advance stuff.
File name : index.py
Django architecture
Django is based on MVT (Model-View-Template) architecture. MVT is a software design pattern for developing a web application.
MVT Structure has the following three parts –
File name : index.py
How to install Django?
Install pip- Open command prompt and enter following command-
python -m pip install -U pip
Install virtual environment- Enter following command in cmd-
File name : index.py
pip install virtualenv
Set Virtual environment
Create a virtual environment by giving this command in cmd-
virtualenv env_site
Change directory to env_site by this command-
File name : index.py
cd env_site
Go to Script directory inside env_site and activate virtual environment-
File name : index.py
cd Script
activate
Install Django
Install django by giving following command-
File name : index.py
pip install django
Creating a Project
To initiate a project of Django on Your PC, open Terminal and Enter the following command
File name : index.py
django-admin startproject projectName
A New Folder with name projectName will be created. To enter in the project using terminal enter command
File name : index.py
cd projectName
Now run
File name : index.py
Python manage.py runserver
Now visit http://localhost:8000/,