Django is the most popular framework of python. Before going for Django you must be knowing the basic knowledge of Python programming language. Python, the versatile programming language, offers a multitude of possibilities for developers. With its clean syntax and extensive libraries, Python allows you to write code that is both concise and readable. Whether you’re a beginner or an experienced programmer, Python’s simplicity and flexibility make it a popular choice for a wide range of applications.
As Django is python programming based framework to install Django, you must first install the python in your system.
Install Python
- Navigate to https://www.python.org/downloads/ python downloads url. Download the latest python version of .exe. Once download is completed, open the exe file and install it in your system as it is simple you just need to do as you do for normal applications in windows.
- Once installation of python is completed you can open the terminal (cmd) and type
python
and hit enter in the cmd. - You should see something similar to below mentioned response in the terminal
Python 3.10.5 (main, Jun 18 2022, 01:16:30) [GCC 12.1.0 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
Install Django in windows
- Once you have installed the python in your system, you can install django in simple one step.
- Open the cmd terminal again the run the below command:
python3 -m pip install Django
- And hit enter. Python will download all the necessary dependency of django and install globally to your system. You can verify by simply typing the
django-admin
in your terminal.
Create your first Django project
Now once your python & django installation is completed, you can create the first django project to see the skeleton or base structure of django project.
Again navigate to your project folder and open the cmd terminal.
Run django-admin startproject myProject
command in your terminal. Here myProject is the project name. You can change as per your convenience. Once you are done with the command, it will create a folder to your directory with project name. Open the folder the you will see below mentioned base structure of django project.
myProject
/manage.py
myProject/
__init__.py
settings.py
urls.py
asgi.py
wsgi.py
In addition to above you can install python Vs Code extension as well in your system. That will be really helpful in writing the python syntax.