Esta página se muestra en inglés. Una traducción al español está en curso.
ConfigsApr 12, 2026·3 min de lectura

Django — The Web Framework for Perfectionists with Deadlines

Django is a high-level Python web framework that encourages rapid development and clean, pragmatic design. Batteries-included: ORM, admin, auth, migrations, forms, caching, and security. Powers Instagram, Spotify, Mozilla, Disqus, and NASA.

Introducción

Django is a high-level Python web framework created by Adrian Holovaty and Simon Willison at the Lawrence Journal-World newspaper in 2003, open-sourced in 2005. Its motto: The web framework for perfectionists with deadlines. Django includes everything you need out of the box: ORM, admin panel, authentication, URL routing, templating, form handling, file uploads, caching, and security middleware.

What Django Does

  • ORM — define models in Python, auto-generate SQL
  • Admin — auto-generated CRUD admin panel
  • Auth — users, groups, permissions, sessions, CSRF
  • Migrations — schema migrations from model changes
  • URL routing — regex and path-based URL dispatcher
  • Templates — Django template language (DTL) or Jinja2
  • Forms — validation, rendering, model forms
  • Middleware — request/response processing pipeline
  • Caching — Redis, Memcached, file, DB backends
  • Security — XSS, CSRF, SQL injection, clickjacking protections
  • Django REST Framework — add-on for building APIs

Architecture

MVT (Model-View-Template): Model is the ORM layer, View handles logic and returns responses, Template renders HTML. WSGI/ASGI compatible — deploy behind Gunicorn, uvicorn, or Daphne. Settings-based configuration via settings.py.

Self-Hosting

# Production
pip install gunicorn
gunicorn mysite.wsgi:application --bind 0.0.0.0:8000 --workers 4

# Docker
FROM python:3.12-slim
WORKDIR /app
COPY requirements.txt .
RUN pip install -r requirements.txt
COPY . .
CMD ["gunicorn", "mysite.wsgi", "--bind", "0.0.0.0:8000"]

Key Features

  • Batteries-included (ORM, admin, auth, migrations)
  • Auto-generated admin panel
  • Django REST Framework for APIs
  • ASGI support (async views)
  • Comprehensive security defaults
  • Mature ecosystem (10,000+ packages)
  • Excellent documentation
  • Huge community

Comparison

Framework Language Philosophy Best For
Django Python Batteries-included Full apps
FastAPI Python Async + types APIs
Flask Python Micro Small APIs
Rails Ruby Convention > config Full apps
Laravel PHP Elegant syntax Full apps
Spring Boot Java Enterprise Enterprise

FAQ

Q: Django vs FastAPI? A: Django is a full-stack framework (ORM, admin, auth all included), suitable for traditional web apps + APIs; FastAPI focuses on high-performance async APIs, suitable for pure API backends and microservices.

Q: Does Django support async? A: Yes. Django 4.1+ supports async views, middleware, and (partial) ORM. Full async ORM is still in progress.

Q: Can admin be used in production? A: Yes for internal management. For user-facing dashboards, customize Django admin or use themes like Django Unfold or Grappelli.

Sources

Discusión

Inicia sesión para unirte a la discusión.
Aún no hay comentarios. Sé el primero en compartir tus ideas.

Activos relacionados