## The
(Unofficial)
History of Django Compiled by [Aaron Yong](https://aarony.dev) #### EdmontonPy Feb 2023
### Topics 1. What is Django? 1. Major Milestones 1. Opinions & Criticisms 1. Community 1. Future
## What is Django? #### [The web framework for perfectionists with deadlines.](https://www.djangoproject.com/start/overview/) - "Kitchen sink", "batteries included" full-stack - Sane defaults, security-minded - Versatile, w/community support - Comprehensive, easy [first steps](https://docs.djangoproject.com/en/4.1/#first-steps)
Named after jazz guitarist Django Reinhardt
## Major Milestones ### From pre-0.95 to 4.1 Sources: - [Django Release Notes](https://docs.djangoproject.com/en/4.1/releases/) - [Wikipedia](https://en.wikipedia.org/wiki/Django_(web_framework)#Version_history) - [Quora](https://www.quora.com/What-is-the-history-of-the-Django-web-framework-Why-has-it-been-described-as-developed-in-a-newsroom/answer/Simon-Willison)
### [Pre-0.95](https://www.quora.com/What-is-the-history-of-the-Django-web-framework-Why-has-it-been-described-as-developed-in-a-newsroom/answer/Simon-Willison) #### 2003-2005 ##### From PHP to Python - Developed in a newsroom - Wanted DRY standards & scalability - New-age tech called **CSS** - URL patterning - CMS admin (now just "Django admin") - HTTP Request/Response: proto-WSGI - Company would open-source Django --- ### [0.95,](https://docs.djangoproject.com/en/4.1/releases/0.95/) [0.96](https://docs.djangoproject.com/en/4.1/releases/0.96/) #### March 23, 2007 ##### Removing the magic - Less automatic code (e.g. auto-plurals) - Clearer/shorter imports - More stable API --- ### [1.0](https://docs.djangoproject.com/en/4.1/releases/1.0/) #### September 3, 2008 ##### Stability, forwards-compatibility - De-coupled `admin` and `models` - Stronger Unicode support 🤩 - XSS mitigation: autoescape outputs in templates --- ### Django REST Framework [0.1](https://github.com/encode/django-rest-framework/tree/0.1) #### Feb 21, 2011 ##### A small* library appears - Would pioneer API-driven Django development - Like Django, has [quick](https://www.django-rest-framework.org/tutorial/quickstart/), simple [tutorials](https://www.django-rest-framework.org/tutorial/1-serialization/)
\* Would actually make a fairly big splash on web dev scene
--- ### [1.4 LTS](https://docs.djangoproject.com/en/4.1/releases/1.4/) #### March 23, 2012 ##### Django's 1st LTS! (EOL Oct 1, 2015) - (1.3) [Class-based views](https://docs.djangoproject.com/en/4.1/topics/class-based-views/): a time-saver* - Time zones support - CSRF: `ensure_csrf_cookie()` decorator - PBKDF2 password storage algorithm - New project layout and `manage.py`
\* Won't magically mean better code though
--- ### [1.8 LTS](https://docs.djangoproject.com/en/4.1/releases/1.8/) #### April 1, 2015 ##### 2nd LTS, not an April Fool's joke - (1.7) Built-in [DB schema migrations](https://docs.djangoproject.com/en/4.1/topics/migrations/) - [Jinja2](https://jinja.palletsprojects.com) & other template engines support - Major `django-secure` features added to Django - ORM additions - (1.7) [QuerySet methods from model manager](https://docs.djangoproject.com/en/4.1/releases/1.7/#calling-custom-queryset-methods-from-the-manager) - (1.7) [Prefetch](https://docs.djangoproject.com/en/4.1/ref/models/querysets/#prefetch-objects) objects - [Query](https://docs.djangoproject.com/en/4.1/ref/models/expressions/) and [conditional](https://docs.djangoproject.com/en/4.1/ref/models/conditional-expressions/) expressions - [Database functions](https://docs.djangoproject.com/en/4.1/ref/models/database-functions/) --- ### [1.11 LTS](https://docs.djangoproject.com/en/4.1/releases/1.11/) #### April 4, 2017 ##### Pre-2.0 - Class-based model indexes (cleaner code) - From Python- to HTML-based form widget authoring - ORM additions - [Subquery](https://docs.djangoproject.com/en/4.1/ref/models/expressions/#django.db.models.Subquery) - [Exists](https://docs.djangoproject.com/en/4.1/ref/models/expressions/#django.db.models.Exists) Less change allowed Djangonauts to prep for 2.0 --- ### [2.0](https://docs.djangoproject.com/en/4.1/releases/2.0/) #### December 2, 2017 ##### Bye Python 2 - Semver-esque versioning convention - Simplified URL routing syntax (thank goodness) ```python # Before url(r'^articles/(?P
[0-9]{4})/$', views.year_archive), # After path('articles/
/', views.year_archive), ``` - Mobile-friendly Django admin --- ### [2.2 LTS](https://docs.djangoproject.com/en/4.1/releases/2.2/) #### April 1, 2019 ##### They can't keep getting away with April Fool's* - Fine-grained constraints via `Meta.constraints` - [CheckConstraint](https://docs.djangoproject.com/en/4.1/ref/models/constraints/#django.db.models.CheckConstraint) - [UniqueConstraint](https://docs.djangoproject.com/en/4.1/ref/models/constraints/#django.db.models.UniqueConstraint)
\* Their LTS release cadence is every 2 years
--- ### [3.0](https://docs.djangoproject.com/en/4.1/releases/3.0/) #### December 2, 2019 ##### How do you do, fellow ~~kids~~ ASGI? 🛹 - Official MariaDB (MySQL fork) support - Start to support* [ASGI](https://asgi.readthedocs.io/), WSGI's async-capable spiritual successor
\* Django middleware, views, ORM, etc. are still synchronous on 3.0
--- ### [3.1,](https://docs.djangoproject.com/en/4.1/releases/3.1/) [3.2 LTS](https://docs.djangoproject.com/en/4.1/releases/3.2/) #### April 6, 2021 ##### Async Views & Middleware - Practical `async` usage - Functional [views](https://docs.djangoproject.com/en/4.1/topics/http/views/#async-views) can be async-capable - So can properly-defined [middleware](https://docs.djangoproject.com/en/4.1/topics/http/middleware/#async-middleware) - [Testing](https://docs.djangoproject.com/en/4.1/topics/testing/tools/#async-tests) is async-aware too! - `django.db.models` upgrades - [Functional indexes](https://docs.djangoproject.com/en/4.1/releases/3.2/#functional-indexes) - More DB backend support for [JSONField](https://docs.djangoproject.com/en/4.1/releases/3.1/#jsonfield-for-all-supported-database-backends) --- ### [4.0 LTS](https://docs.djangoproject.com/en/4.1/releases/4.0/) #### December 7, 2021 ##### Use Python's time zone support - Replaced `pytz` with Python's [zoneinfo](https://docs.python.org/3/library/zoneinfo.html#module-zoneinfo) - Forms, Formsets, ErrorList are now rendered using template engine - Stronger `scrypt` password hasher added - Built-in [Redis cache](https://docs.djangoproject.com/en/4.1/topics/cache/#redis) support --- ### [4.1](https://docs.djangoproject.com/en/4.1/releases/4.1/) #### August 3, 2022 ##### Where we are today - [Async class-based views](https://docs.djangoproject.com/en/4.1/topics/class-based-views/#async-class-based-views) - [ORM is also becoming async-capable](https://docs.djangoproject.com/en/4.1/topics/db/queries/#async-queries)
## Opinions & Criticisms ### My personal hot takes 🔥
### Is Django still worth learning? ## Yes. --- ### Support from Django Software Foundation & open-source community --- ### While it may not win in performance benchmarks, a dev can get up to speed fast. Development time usually exceeds performance considerations
Python itself
has been getting faster
--- ### Django does a good job helping new devs write safer, cleaner code Reusable patterns, sane defaults, proper warnings where possible --- ### Packages I Enjoyed - [Django Debug Toolbar](https://pypi.org/project/django-debug-toolbar/) - Visual SQL query inspector 😍 - Close 2nd: template rendering time profiler - [Wagtail CMS](https://wagtail.org/) - NASA, Google, NHS 👀 - [Django REST Framework](https://www.django-rest-framework.org/) - API development stalwart in a SPA-filled world --- ## Criticisms --- ### Django relies on its own ORM The knowledge base built around its ORM is tougher to port over
I find myself wondering why other ORMs "aren't like Django's", for better and for worse.
Mitigated by understanding my use case and abstracting my problem.
--- ### Django's own template engine gets far more attention Most template tutorials, guides, and packages rely on Django's engine instead of other venerable ones like Jinja2.
Again, I find myself wondering why other template engines "aren't like Django's"
--- ### It has always had strongest support for PostgreSQL It reached a boiling point when Django 1.8 added [PostgreSQL-specific model fields](https://docs.djangoproject.com/en/4.1/ref/contrib/postgres/).
Why aren't other competing DBs as feature-filled as PostgreSQL?
--- ### Lack of NoSQL support Though, you might get away with relation DBs and `JSONField`... ...and I have a bone to pick about "schemaless" thought (or lack thereof)
Those who "hate migrations" end up paying the debt in their app logic
and/or JSON/YAML eventually
--- ### Its `async/await` support A lot of tutorials & guides are written for synchronous Django With Django 4.x, `async` has improved (ORM, views, middleware) [Django Channels](https://channels.readthedocs.io/en/stable/) is supported by the DSF & supercharges Django's ASGI capabilities.
Remember: ASGI is not some free magical performance enhancer
A bad (async) ORM query will (still) be super slow! 💣
## Community
### Who uses Django? Pinterest, Instagram, Udemy, and many more! Source: [Stackshare](https://stackshare.io/django) --- ### DjangoCon(s) Big enough to have not one, but _two_ annual conventions! #### [US](https://2023.djangocon.us/) and the [EU](https://2023.djangocon.eu/) --- ### [Django Girls](https://djangogirls.org) Non-profit organization and community Empowering & helping women organize free, 1-day workshops --- ### [Dev Edmonton Society](https://devedmonton.com/) #### Find us in #meetup-edmontonpy and #django 🐍
## Future
### It's looking forwards-compatible There will always be new web technologies. Django won't be the first to adopt them. It will do so while ensuring your websites keep ticking.
We are forced to learn so much, so quickly that Django's stability is appreciated.
--- ### Expanding My Horizons After Djangonauting for 3+ years, I explored [FastAPI](https://www.django-rest-framework.org/).
Sacrilege?! _Nonsense_.
#### Different tools for different jobs.
FastAPI's [SQLAlchemy tutorial](https://fastapi.tiangolo.com/tutorial/sql-databases/) feels like a step backwards from Django's ORM 😵
I'm grateful learned Django before FastAPI, not the other way around.
## Conclusion #### Django is and will continue to be a venerable web framework [Get started](https://www.djangoproject.com/start/) & join fellow Djangonauts 🚀 --- ## Thank you 🥳 #### Questions?