Django is an open-source web framework written in the Python programming language. Named after the jazz guitarist Django Reinhardt, it is used by some of the largest websites in the world including Instagram, Mozilla, and NASA, but also lightweight enough to be a popular choice for weekend side projects and startups. Its "batteries-included" approach means a powerful website can be generated quickly in the hands of a skilled developer.
Web Framework
A "web framework" is software that standardizes and abstracts away common difficulties and redundancies involved in making a website. For example, most websites need to connect to a database, deploy to a server, handle URL routing, security, user registration, generate templates, and so on. In the early days, programmers had to do all of this from scratch but they quickly recognized the commonalities and started creating web frameworks.
These days, it is rare to write a website from scratch. Web frameworks exist for every modern programming languages including Rails for Ruby, Express for JavaScript, and Django or Flask for Python.
Beyond the underlying programming language, the major difference between competing web frameworks is one of approach: Ruby on Rails and Django both adopt a "batteries-included" frameworks approach whereas Flask and Express are minimal microframeworks. You can think of it as the difference between being given a bag of Legos or a pre-built truck made out of Legos. Django and Rails are faster to start using and come with many built-in guardrails to prevent bad practices. Flask and Express require more customization upfront but allow for total control. See Django vs Flask for a detailed comparison of the two most popular Python web frameworks and the pros/cons of each approach.
Python
Python is one of the most popular programming languages in the world because it is friendly to newcomers, extremely powerful, and has a robust ecosystem of libraries like Django that provide additional functionality. Python recently replaced Java as the most popular programming language at top U.S. universities and is growing rapidly among professional programmers as well, as evidenced by its growth on StackOverflow.
Python emphasizes readability and developer friendliness, as evidenced by its "Hello, World" syntax. Here it is in Python:
print("Hello, World")
And here it is in Java:
class HelloWorldApp {
public static void main(String[] args) {
System.out.println("Hello World!");
}
}
Even if you know nothing about either programming language, it is clear at a glance that Python is the easier of the two to understand.
Background
Django was initially developed by web programmers at the Lawrence Journal-World newspaper, specifically Adrian Holovaty, Simon Willison, and Jacob Kaplan-Moss. It was first released to the public as an open source package in 2005 and is currently maintained by the non-profit Django Software Foundation. The source code is freely available online.
Key Features
Django adopts a "batteries-included" approach similar to Python and comes with a number of built-in features including an extensible authentication system, robust admin app, lightweight testing web server, and support for multiple databases including PostgreSQL, MySQL, MariaDB, Oracle, and SQLite. It is known for its leading security best practices and comes with comprehensive documentation, available either online or as a PDF/ePUB for offline consumption.
As a mature project, Django rarely makes breaking changes and has a clear deprecation schedule for any updates. A major new version is released every nine months or so with monthly patch releases for security and bug fixes.
There is also a vibrant ecosystem of third-party applications--visible on the Django Packages site--which provide additional functionality. Over time, the most popular packages are often rolled into Django itself.
Community
A common saying among Django developers is "Come for the framework, stay for the community." It is known for being a welcoming and encouraging community, which is not always the case in technology. There are annual DjangoCon conferences hosted in the U.S, Europe, Australia, and Africa, as well as meetups in many major cities.
Questions about Django can be asked on the official Django forum and newcomers are encourage to contribute to Django itself.
The weekly Django Chat podcast features interviews with key figures in the community as well as deep dives on various core features. There is also a weekly Django News newsletter with updates on events, tutorials, and third-party packages.
Conclusion
If you'd like to learn more about Django and try it out yourself, there is an official tutorial as well as many more beginner friendly resources available on LearnDjango.com.
Top comments (0)