While the Ruby world is buzzing about Rails, a quiet revolution has been happening in the newsroom of the Lawrence Journal-World. Adrian Holovaty and Simon Willison have just open-sourced "Django," the framework they’ve been using to build complex, database-driven sites on incredibly tight deadlines. And if you’re a Python fan, this is the framework you’ve been waiting for.
Django calls itself "the web framework for perfectionists with deadlines," and it lives up to the name. Unlike Rails, which favors "magic" and convention, Django favors explicit Pythonic code and "Batteries Included."
What does "Batteries Included" mean? It means that out of the box, you get a world-class Object-Relational Mapper (ORM), a robust template system, a form handling library, and-the killer feature-an automatically generated administrative interface.
If you’ve ever spent days building a CRUD (Create, Read, Update, Delete) backend for your clients so they can edit their own content, you’re going to love Django. You just define your data models, and Django generates a professional, secure, and functional admin site for you. It’s a massive time-saver.
# A simple Django model
from django.db import models
class Article(models.Model):
title = models.CharField(max_length=200)
pub_date = models.DateTimeField('date published')
content = models.TextField()
Django also takes security seriously. It has built-in protection against common web vulnerabilities like SQL injection, cross-site scripting (XSS), and cross-site request forgery (CSRF). In the Wild West of 2005 web development, having these defaults is a breath of fresh air.
The architecture follows a "Model-Template-View" (MTV) pattern, which is just a slightly different name for MVC. It keeps your logic, your data, and your presentation strictly separated.
For those of us who find Rails a bit too "opinionated" or "magical," Django offers a more structured, explicit, and-dare I say-professional alternative. It’s built for the long haul, and I expect we’ll be seeing it power some very large sites in the years to come.
Aunimeda develops websites and web applications for businesses - corporate sites, e-commerce, portals, and custom platforms.
Contact us to discuss your web project. See also: Web Development, E-commerce Development