Django and The MVC pattern in web development
Django is a web framework built in python, it enables you to build clean, feature-rich application in less amount of time.
Web development has made a lot of progress during the last few years. It began as a tedious task that involved CGI interfacing external programs with the web server. CGI applications used the standard I/O facilities available to the C programming language in order to get user input and produce the required page output. In addition to being difficult to work with, CGI required a seperate copy of the program to be launched for each requests , which quickly overloaded the servers.
Then, new scripting languages were introduced to the web development, and this inspired developers tocreate more efficient technologies. Languages such as Perl and PHP quickly made their way into the world of web development, and as a result common web tasks such as cooking handing, session management and text processing became easier. Although these scripting languages had the libraries, to deal with the day to day web tasks, they lacked unified frameworks, as libraries were fundamentally different in design, usage and conventions. Therefore, the need for cohesive frameworks arose.
Few Years Ago, The MVC (Model View Controller) was introduced to the world of web development for building of web based applications. This software engineering pattern seperates data(Model), user interface(View), and data handling logic(Controller), so that one can be changed without affecting the other. The Benefits are that designers can work on the interface without worrying about data storage and Management. And Developers can think and code on the logic of Data Handling without worrying about the presentation.
Now how does Python come into play ? Although python is used for build wide variety of applications, it is also very suited for web applications. It has a clean and elegant syntax and is supported by large library of modules which covers everything , from multi-threading to the zipping of files. Python laguage’s Object Oriented model is very well suited for the MVC style of web development.
As you can see performance is a very big concern with many of the web projects and it will always be with any of the new coming web projects. And in such situations, Python’s runtime environment does a very good job. as it is known to be fats and stable. Python supports wide range of web servers which include famous names like Apache, nginx, IIS, lighttpd, etc. Python also supports a wide range of Database servers, whch also includes some famous names like MySQL, PostGreSQL, etc. And if you are using Django framework, you don’t need to deal with the databases directly, Django provides a unified layer of access to all database engines.
Advantages of Python :-
1) Clean and elegant syntax.
2) Large standard library of modules that covers a wide range of tasks.
3) Extensive documentation.
4) Mature runtime environment.
5) Support for standard and proven technologies such as Linux, Apache, MySQL and also other famousweb servers and database servers.
Django ?
There are so many frameworks in python such as cherrypy, web.py, Albatross, Quixote, Spyce, Webware, pylons, grok, zope, turbogears, so, what sets Django apart from these ?
Tight integration between components:- Django provides a set of tightly integrated components; all of these components have been developed by the Django team themselves. Django’s components were designed for integration, reusability and speed from the start.
Object-Relational Mapper:- Django’s database component, the Object-Relational Mapper (ORM), provides a bridge between the data model and the database engine. It supports a large set of database systems, and switching from one engine to another is a matter of changing a configuration file. This gives the developer great flexibility if a decision is made to change from one database engine to another.
Clean URL Design:- The URL system in Django is very flexible and powerful; it lets you define patterns for the URLs in your application, and define Python functions to handle each pattern. This enables developers to create URLs that are both user and search engine friendly.
Automatic Administration Interface:- Django comes with an administration interface that is ready to be used. This interface makes the management of your application’s data a breeze. It is also highly flexible and customizable.
Advanced Development Environment:- Django provides a very nice development environment. It comes with a lightweight web server for development and testing. When the debugging mode is enabled, Django provides very thorough and detailed error messages with a lot of debugging information. All of this makes isolating and fixing bugs very easy.
Multi-Lingual Support:- Django supports multi-lingual websites through its built-in internationalization system. This can be very valuable for those working on websites with more than one language. The system makes translating the interface a very simple task.











