Recs.
Updated
Django is used in many high-visibility environments (evidenced by the who uses django section on the homepage), and has a substantial history. Embraces commonly-used MVC pattern, and is servable with a number of popular web servers.
SpecsUpdate
Pros
Pro Mature software with many plugins developed over the years
Django was first released in 2006, it has had a lot of time to mature and become better with each release. It also has by far the largest community out of all python frameworks who have continuously over the years built and maintained many powerful plugins.
Pro ORM support
Django supports Object-Relational Mapping. With models defined as Python classes which are actually subclasses of Django's django.db.models.Model
. Each attribute of the model is then represented as a database field. Queries are lazily executed and Django gives developers an automatically-generated database-access API.
Pro Mature and proven software
Over time, Django became not just an implementation of an idea of a framework, but a way to organize your code and a web application's work flow. It provides a good default implementation for everything: sessions, persistence, rest api and other things. When you outgrow the default mechanism, you can replace it with your own.
Pro Top notch documentation and help from community
The official Django documentiation is probably some of the best around. Well written, thorough and they explain every little detail of the framework. Django is also a very popular tool, with an extensive community and a lot of experienced developers that have been using it for years. This means that there are a lot of guides and tutorials out there for new and experienced developers alike.
Pro Simple database management
Just a few lines of code can instruct Django to create all the tables and fields required in your database automatically. Schemas are managed with "migrations", that are also created automatically, and can be rolled out from your development box and implemented on production systems with just a single command.
This performs any database changes required, from table creation, indexes, renaming fields, and pre-populating initial data. Each migration builds on the previous migrations, so you can trace the evolution of your data and even recreate the layout of your database at any point in the lifecycle of your application.
Pro There is no "magic"
The code is explicit. Contrary to Rails / Symfony 1 and other frameworks; you don't need any knowledge to "reverse engineer" some code.
Cons
Con Template errors fail silently by default
If you make a typo in a template variable, or change a view so that variable is no longer passed to the template, you won't get an error message pointing out that something has gone wrong. That reference will just be treated as if it is an empty string instead.
There is a way to configure this, but since so many templates have been written assuming this behavior, nobody ever enables template errors because it would break so much of the existing support tools (e.g. the built-in admin interface).
Con Changes too fast
Django changes too fast. This means old sites constantly need to be fixed and that new books on Django become out of date after only 2 years.
Con There is no "magic"
If syntactic sugar is a bad thing, then those people that think so should program in some form of machine language.
Con Routing requires some knowledge of regular expressions
Given a GET request for /topics/426/viewpoints/1/sections/create
, how does Django decide which bit of Python code is invoked to handle it?
It compares the request path to your giant pile of regular expressions.
And then if there's some other regular expression starts matching /top
and all your requests for /topics/
start going there, good luck figuring out why. You won't be informed of any conflict until you notice you seem to be getting the wrong pages back.
The structure of URL paths is almost universally hierarchical. There is no call to have anything as ridiculously flexible (and notoriously hard-to-read) as regular expressions to organize request routing.
But starting from Django 2, you do not need to use regex with paths.
Recommendations
Comments
Flagged Pros + Cons
Con Can feel bloated for small projects
Django's sheer scale and functionality can feel clunky and bloated for small applications. It has too many bells and whistles which can get in the way when developing a small scale application.
Pro ORM support out of the box
Django supports Object-Relational Mapping. With models defined as Python classes which are actually subclasses of Django's django.db.models.Model
.
Each attribute of the model is then represented as a database field. Queries are lazily executed and Django gives developers an automatically-generated database-access API.
Pro Has an admin panel out of the box
Django comes with a highly customizable admin panel and authentication out of the box. This makes the development and production of a simple CMS extremely easy.