MSK Institute LogoMSK.Institute
HomeCourses
Book Free Demo➔Sign In
Free Demo➔
MSK Institute LogoMSK.Institute

Leading computer training academy in Shikohabad for software engineering, Python, web development, and digital literacy.

ISO 9001:2015 Certified Center
Follow & Connect
4.9

Programs & Admissions

  • All CoursesCatalog
  • Learning PathsRoadmaps
  • Student ProjectsShowcase
  • Live Classes & ScheduleLive
  • Upcoming Batches
  • Campuses & LocationsHub
  • Verify Certificates
  • Book Free Demo Class

Resources & Tools

  • Free Online Mock TestsAll Tests
  • NIELIT CCC Mock TestFree
  • Course & Career FinderQuiz
  • Study Material Hub
  • All MSK ToolsHub
  • Keyboard ShortcutsNew
  • TypeQuest Speed LabTyping
  • MSK Code PlaygroundCode
  • Interactive Tutorials
  • Quick Cheatsheets

Institute & Contact

  • About MSK Institute
  • Careers & InternshipsHiring
  • Publications & Blogs
  • Gali No. 3, Near Gyan Jyoti Public School,
    Adarsh Nagar, Shikohabad, Uttar Pradesh 283135
  • +91 83930 42166
  • mskshikohabad@gmail.com
  • Hours:Mon – Sat: 8:00 AM – 7:00 PM | Sun: 10:00 AM – 2:00 PM
  • 4.9 ★(38 Google Reviews)
© 2026 MSK Institute. All rights reserved.•Privacy Policy•Terms of Service•Disclaimer•Contact Us

Shikohabad's Leading Computer & Coding Academy

Home
Courses
Live
Material
Installing Django & Environment Setup0%
Study Materials
Django for Backend DevelopmentProgress 0%
1.1Installing Django & Environment Setup1.2Django Project Structure1.3Creating First Django App
HomeTutorialsDjango for Backend DevelopmentInstalling Django & Environment Setup
Django Project Structure

Installing Django & Environment Setup

Beginner12 min read•Updated: 2026-11-18•By Er. Sumit Kumar (MSK Institute)
Study MaterialsCheatsheet

Django is a high-level Python web framework designed for rapid, secure, and maintainable software engineering. Following the "batteries-included" philosophy, Django ships out of the box with an Object-Relational Mapper (ORM), database migration engine, administrative dashboard, user authentication, and CSRF/XSS security protections.


1. Setting Up an Isolated Virtual Environment

Never install Python web frameworks into your global operating system environment. Dependency version conflicts between packages can break OS-level tools or other projects.

1# 1. Create a dedicated virtual environment
2python -m venv venv
3 
4# 2. Activate virtual environment
5# On macOS / Linux:
6source venv/bin/activate
7 
8# On Windows (PowerShell):
9.\venv\Scripts\Activate.ps1
10# On Windows (CMD):
11.\venv\Scripts\activate.bat

Verify that the active python binary points inside your virtual environment:

1which python # or 'Get-Command python' on Windows

2. Installing Django and Freezing Dependencies

1# Upgrade pip package installer
2python -m pip install --upgrade pip
3 
4# Install latest production Django release
5pip install django
6 
7# Verify Django installation and version
8python -m django --version
9 
10# Freeze active dependencies into requirements.txt
11pip freeze > requirements.txt

A clean requirements.txt enables deterministic dependency reproduction across teammates and staging/production Docker containers.


3. Creating the Project and Running the Local Dev Server

In Django terminology, a Project is a collection of configurations and applications for a given website.

1# Initialize a new Django project named 'config' inside the current directory
2django-admin startproject config .
3 
4# Apply initial core migrations (auth, contenttypes, sessions)
5python manage.py migrate
6 
7# Launch the local HTTP development server
8python manage.py runserver 8000

Navigate to http://127.0.0.1:8000/ in your browser. You will see Django's default rocket launch greeting page confirming a successful setup!


4. Understanding the manage.py Script

The manage.py file is a thin executable wrapper around django-admin that sets the DJANGO_SETTINGS_MODULE environment variable to point to your project's settings.py.

Common manage.py commands:

  • python manage.py runserver: Launches the development web server.
  • python manage.py makemigrations: Generates new database migration files based on model changes.
  • python manage.py migrate: Executes pending SQL migrations against the database.
  • python manage.py createsuperuser: Creates an administrative user for /admin/.
  • python manage.py startapp <app_name>: Scaffolds a new application module.
  • python manage.py shell: Opens an interactive Python REPL with Django loaded.

Interactive Quiz• Knowledge Check

Practice Quiz

Question 1
Why is it critical to install Django inside a Python virtual environment?
Question 2
What is the primary difference between django-admin and manage.py?
Question 3
What command runs initial database migrations to configure auth and session tables?
Question 4
What does the command pip freeze > requirements.txt accomplish?
Question 5
Why is python manage.py runserver intended strictly for local development?
Next Lesson

Django Project Structure

Continue learning with hands-on practice, examples, and exercises in the upcoming topic.

Related Lessons

Previous LessonNext Lesson
NoneDjango Project Structure

Practice Quiz

Test your understanding of this lesson with 5 questions. Each question has one correct answer.

Mentor-Led Practical Training

Master Django for Backend Development with Hands-On Projects

Practice in live mentor-led sessions with real projects, mock tests, and verifiable certification at MSK Institute.

View Full CourseBook Free Demo
Next
PreviousPrevNext