History of Django

  • Learn how Django was created and how it evolved into a powerful Python web framework.
  • Why History of Django is Important for Students?

    Understanding Django’s history helps students:

    • Know why Django exists

    • Understand design decisions

    • Appreciate best practices

    • Gain confidence in Django as a career-safe framework

    1. Who Created Django?

    Creators:

    Django was created by a team of web developers at World Online (a newspaper company in the USA).

    Key People:

    • Adrian Holovaty

    • Simon Willison

    • Jacob Kaplan-Moss

    Year:

    2003 (released publicly in 2005)

    Name Origin:

    The framework is named after Django Reinhardt, a famous jazz guitarist.

    Why This Matters:

    • Django was built by real developers

    • Designed for real production problems

    • Not an academic or experimental framework

Django Creator Philosophy (DRY) Principle Example

Shows Django’s core philosophy – Don’t Repeat Yourself

# Instead of repeating logic everywhere
def calculate_total(price, tax):
    return price + tax

# Reusing the same function
total1 = calculate_total(100, 10)
total2 = calculate_total(200, 20)
  • Explanation:
    Django strongly follows DRY, which came from real newsroom needs.

    2. Why Django Was Created?

    Problem Before Django

    Before Django, web development was complicated and repetitive.

    Developers had to:

    • Write SQL queries manually

    • Create authentication system again and again

    • Handle security logic manually

    • Write repetitive boilerplate code

    • Manage URLs, forms, sessions separately

    This made development:

    • Slow

    • Error-prone

    • Hard to maintain

    • Less secure

    Real-World Requirement

    At the time, the news organization World Online needed a system to:

    • Publish news articles quickly

    • Handle high traffic

    • Maintain strong security

    • Update content daily

    They needed a framework that was:

    • Fast

    • Scalable

    • Secure

    • Easy to maintain

    Django’s Purpose

    Django was created with one clear goal:

    "Make it easier to build better Web apps more quickly and with less code."

    Main Goals of Django

    1.  Rapid Development

    2. Clean & Maintainable Code

    3. High Security

    4. Reusable Components

    5. Built-in Admin Panel

    6. Powerful ORM

    Django ORM vs Raw SQL

    Without Django (Raw SQL)

Why Django ORM Was Introduced

This example shows how Django simplified database operations compared to writing raw SQL queries manually.

# Connecting and writing SQL manually
cursor.execute("SELECT * FROM student WHERE age > 18")
rows = cursor.fetchall()

for row in rows:
   print(row)
  • Problems:

    • Need to write SQL manually

    • Risk of SQL Injection

    • Hard to maintain

    • Database dependent code

    • More boilerplate

With Django ORM

# models.py
from django.db import models

class Student(models.Model):
   name = models.CharField(max_length=100)
   age = models.IntegerField()
# views.py
from .models import Student

students = Student.objects.filter(age__gt=18)

for student in students:
   print(student.name, student.age)
  • Explanation

    Raw SQL

    Django ORM

    Write SQL manually

    Write Python code

    Database dependent

    Database independent

    More security risk

    Built-in protection

    More code

    Less code


    Why ORM Was a Big Revolution?

    • Developers focus on business logic

    • No need to worry about SQL syntax

    • Automatic protection against SQL injection

    • Clean & readable code

    • Works with multiple databases (SQLite, MySQL, PostgreSQL)

    3. Evolution & Versions of Django

    Django Evolution Timeline:

    Year

    Version

    Major Changes

    2005

    Django 0.90

    First public release

    2008

    Django 1.0

    Stable API

    2015

    Django 1.8

    LTS version

    2017

    Django 2.0

    Python 3 only

    2021

    Django 3.2

    LTS, async support

    2023

    Django 4.x

    Improved security

    2024–25

    Django 5.x

    Modern async & performance


    LTS (Long Term Support) Versions:

    • Supported for 3+ years

    • Used in enterprise projects

    • Stable and secure

Checking Django Version

Helps developers know which Django version is installed

import django
print(django.get_version())
  • Explanation:
    Important for compatibility and upgrades.

    4. How Django Improved Over Time

    Improvements Across Versions:

    1. Performance

    • Faster ORM queries

    • Async views

    2. Security

    • Stronger password hashing

    • Better CSRF protection

    3.Developer Experience

    • Better error messages

    • Cleaner project structure

    Code Example: Old vs New Django View Style

    Old Style View:

Evolution of Django Views

Shows modernization of Django code

def home(request):
    return HttpResponse("Hello Django")

Modern Async View (Django 4+):

async def home(request):
    return HttpResponse("Hello Django Async")
  • Explanation:
    Django evolved with modern web standards.


    5. Why Django is Still Relevant Today?

    ✔ Reasons:

    • Backed by Django Software Foundation

    • Used by big companies

    • Regular updates

    • Large community

    • Excellent documentation

    Code Example: Built-in Security Example

Django Security by Default

Shows automatic CSRF protection

<form method="post">
    {% csrf_token %}
    <input type="text" name="username">
    <button type="submit">Submit</button>
</form>
  • Explanation:
    Security was a core reason Django was created.