Django is a web framework written in Paython. It’s free and open source web framework, used for rapid development. The Django project website defines Django as
“Django is a high-level Python Web framework that encourages rapid development and clean, pragmatic design. Built by experienced developers, it takes care of much of the hassle of Web development, so you can focus on writing your app without needing to reinvent the wheel. It’s free and open source.”
Before start exploring about the Django, lets get an idea of what is web framework. Because most of the people compare Django with WordPress or tools like WordPress. Which is not correct?
Web framework is a package of software which provides code libraries to the developer to develop and design, scale-able, reliable, secure and maintainable dynamic websites, web applications and web services.
There are number of web frameworks available in Python. Web frameworks are divided into two types high level frameworks and micro frameworks.
High level frameworks
High level web frameworks are the ones which are used by perfectionists and used to maintain and develop large scale applications. Few examples are,
- Turbo Gears
Micro level frameworks
Micro level frameworks are the ones which are having minimal functionality of web frameworks. Microframeworks lacks most of the functionality available in high end frameworks. These frameworks are handle to develop small scale websites. Few examples of microframeworks available in python language are,
If you want to know in detail the complete list of web frameworks available for Python, please visit wiki python. This page provides good information about the frameworks and a brief introduction of each framework as well.
Django, the web framework for perfectionists with deadlines. Django is free open source high level Python web framework that aims fast and rapid development of web applications. Django follows the MVC (Model-View-Controller) pattern architecture, emphasizes on plug-able and reusable components and the principle of DRY (Don’t Repeat Yourself). Django is maintained by Django Software Foundation. Django contains ORM (Object Relational Mapper) which bridges between data models and relational database, a web template system for processing HTTP request and regular-expression-based URL dispatcher. Django core framework provide following builtin components,
- ORM, defines data models in Python, which includes dynamic database APIs.
- URL, define clean URLs by using regular expression. I will discuss URL and views in detail in later posts.
- Template contains the static HTML output part and special syntax for displaying dynamic content on the page.
- Forms, a powerful library included in the framework which handles data validation, HTML rendering of form and converting HTML input values into Python types.
- Authentication library includes user accounts, groups, permission and cookie based user session.
- Admin interface is a powerful feature of Django. It automatically reads the meta data from model class and provides interface to add/update contents.
- Internationalization library support multi-lingual and localization of date & time, numbers and time zones.
- Security component provides protection against Cross-site scripting, SQL injection, Cross Site Request Forgery (CSRF) and Remote code execution.
I will explain in depth each of the above mentioned components in detail in my upcoming posts. Some of the well known sites that uses Django are Pinterest, Instagram, NASA, Mozilla, The Washington Times, National Geographic, Disqus, the Public Broadcasting Service, Bitbucket.
In the next post we will try our first Hello World program using Python tools for Visual Studio.