The Wayback Machine - https://web.archive.org/web/20240623203126/https://www.geeksforgeeks.org/djnago-installation-and-setup/
Open In App

Django Installation and Setup

Last Updated : 10 Apr, 2024
Improve
Improve
Like Article
Like
Save
Share
Report

Installing and setting up Django is a straightforward process. Below are the step-by-step instructions to install Django and set up a new Django project on your system.

Prerequisites: Before installing Django, make sure you have Python installed on your system.

How to Install Django?

To Install Django in Linux and Mac is similar, here I am showing it in Windows for Linux and Mac just open the terminal in place of the command prompt and go through the following commands.

Step 1: Install Pip

Open the command prompt and enter the following command-

python -m pip install -U pip

Install Django

Install Pip

Step 2: Set Virtual environment:

Setting up the virtual environment will allow you to edit the dependency which generally your system wouldn’t allow. Follow these steps to set up a virtual environment-

Step 3: Create virtual environment in Django:

We should first go the directory where we want to create the virtual environment then we type the following command to create virtual environment in django.

python -m venv env_site

a

Create Virtual Environment

then we need to activate virtual environment in django

Step 4: Activate the virtual environment:

Run the activation script located in the bin directory within the virtual environment folder

  • For Windows:
.\env_site\Scripts\activate.ps1
  • For MacOs/Linux:
source env_site/bin/activate

Step 5: Install Django:

Install django by giving following command

pip install django

3

Install Django

Django Setup

Once Django is installed, we can start to create a new Django project.

Step 1: Start a new Django Project

Start a project by following command-

django-admin startproject geeks_site

4

Start a new Project Django

Step 2: Navigate to the Project Directory

Change directory to geeks_site

cd geeks_site

4

Step 3: Start the server

Start the server by typing following command in cmd-

python manage.py runserver

5

Start Django Server

Step 4: Verify Server Status

To check whether server is running or not go to web browser and enter http://127.0.0.1:8000/ as URL.

Introduction to Django and Installation


Previous Article
Next Article

Similar Reads

Django REST Framework Installation
Django REST Framework can be installed via pip package similar to Django installation. Since Django REST Framework is a wrapper over default Django Framework, to install it, Django should be installed already. Now to install rest framework follow the below process. Prerequisites Python Pip Django How to install Django REST Framework To install Djan
1 min read
Django Channels - Introduction and Basic Setup
Django is a powerful Python framework for web development. It is fast, secure, and reliable. Channels allow Django projects to handle HTTP along with asynchronous protocols like WebSockets, MQTT, chatbots, and more. Channels: Channels preserve the synchronous behavior of Django and add a layer of asynchronous protocols allowing users to write the v
6 min read
Setup Sending Email in Django Project
Haven't you observed, when you register on some websites, you get mail from that company or institution? The email would be, a verification email or welcome email, account creation successful email or thanks-regard email, etc. For example, when you create a Google account, the first mail you get would be something like, "Hi Xyz, Welcome to Google.
3 min read
Django+React Full Stack Development Setup using Dact
When we work on a project having Django as our Back-end and having a powerful front-end using React, the development setup takes a significant amount of time to setup - configuring Babel, Webpack, URLs, views, etc. We used to set up this earlier to get started with ReactJS before npx create-react-app came. The npx create-react-app command enables u
2 min read
Adding Tags Using Django-Taggit in Django Project
Django-Taggit is a Django application which is used to add tags to blogs, articles etc. It makes very easy for us to make adding the tags functionality to our django project.Setting up Django Project Installing django-taggit pip install django-taggitADD it to Main Project's settings.py file C/C++ Code INSTALLED_APPS = [ 'django.contrib.admin', 'dja
2 min read
How to customize Django forms using Django Widget Tweaks ?
Django forms are a great feature to create usable forms with just few lines of code. But Django doesn't easily let us edit the form for good designs. Here, we will see one of the ways to customize Django forms, So they will look according to our wish on our HTML page. Basically we will check the methods to include our own custom css, classes, or id
3 min read
Integrating Django with Reactjs using Django REST Framework
In this article, we will learn the process of communicating between the Django Backend and React js frontend using the Django REST Framework. For the sake of a better understanding of the concept, we will be building a Simple Task Manager and go through the primary concepts for this type of integration between React js and Django. Reactjs in a nuts
15+ min read
Styling Django Forms with django-crispy-forms
Django by default doesn't provide any Django form styling method due to which it takes a lot of effort and precious time to beautifully style a form. django-crispy-forms solves this problem for us. It will let you control the rendering behavior of your Django forms in a very elegant and DRY way. Modules required:django : django installdjango-crispy
1 min read
Introduction and Installation of Uberi/Speechrecognition in Python
One of the best library for speech recognition in Python and uses various engines and API to perform speech recognition online as well as offline. Installation Use this command in cmd or terminal make sure Python is installed and Python path is also stored in pc. pip install speechrecognition OR Download resources from PyPI and extract it in a fold
2 min read
Wand Python - Introduction and Installation
Imagemagick is a tool developed to convert images from one format to another. Due to a versatile range of image formats and its precise and simple working, it has a huge community support. We can get images from pdf files. Wand is a binding developed for python by Imagemagick.wWand opens and manipulate images. Wand provides a large number of functi
2 min read
Article Tags :
Practice Tags :
three90RightbarBannerImg