What is Web Development
Web development is a broad term for any work that involves creating a web site for the Internet or an intranet. The end product of a web development project varies from simple sites composed of static web pages to complex applications that interact with databases and users. The list of tasks involved in web development includes web design, web content development, client-server scripting, web server and network configuration and e-commerce development. Usually, web development means the non-design aspect of building web sites: coding.
Large enterprises often have hundreds of people working in its IT / web development department. For example, an university often requires lots of web developers, graphic designers, information system architects to work on its vast web-based infrastructure so that students can register classes, professors can upload scores of the exams, etc. In contrast, smaller companies and individuals often require one or two web developers and / or graphic designers to create a web site for them.
What is a Web Framework
In order to work on a web development project, a programmer is required to leverage one of the numerous web frameworks to write code that's dedicated to function as a highly efficient and scalable web server that manages and serves content to end users.
A web framework is a software library that is designed to help the development of any web site. By packaging common web functionalities into itself, a web framework allows programmers to create web sites using out-of-the-box code and infrastructure so that they can focus on building business logic oriented features of the web site instead of writing code that deals with common web programming tasks over and over again. For example, most web frameworks provide libraries for database access, templating engine and web session management. Without a web framework, one would be forced to write the same boiler-plate code to handle these common tasks whenever one starts to work on a new project.
What is Django
Django is a free and open source web framework for Python. After its first release in 2005, it became more and more popular among Python programmers as the
de-factor framework for web development. Django emphasizes reusability and pluggability of components so that distinctive pieces of code can be plug-n-played together to form a cohesive web system.
Another principle promoted by Django is DRY (Don't Repeat Yourself). DRY aims at reducing repetitive pieces of information of all kinds in software development. For example, instead of writing the server's static folder as a raw string everywhere in the code, we should assign the static folder's address to a constant defined in the application's settings file so that we can easily change it in the future.
Besides providing libraries for common web tasks such as database interaction and session management, Django also provides an built-in
admin site that allows programmers and administrators of the web site to easily create, read, update and delete database records from a GUI interface.
Websites Powered by Django
Here's a non-exclusive list of web sites powered by Django:
- pinterest.com: Pinboard-styled photo sharing site.
- bitbucket.org: Code sharing site.
- instagram.com: Photo sharing site.
- addons.mozilla.com: Firefox browser's addon management site.
- disqus.com: Blog-comment hosting site for communities.
As you can see, Django is more than capable to host some of the most popular social sharing websites such as Pinterest and Instagram as well as some of the most mission critical websites such as Bitbucket. Due to the best software practices promoted and maintained by Django, big companies are also starting to adopt the new technology and slowly transitioning out of J2EE.
Django vs. Other Python Web Frameworks
Of course, Django is not the only Python web framework out there. Other popular Python web frameworks are:
- Flask: An open source micro web framework that provides only the core libraries of web development. It does not provide database abstraction, form validation or any other component that can be provided a third-party component. Unlike Django, the number of out-of-the-box components provided by Flask is kept to a bare minimum, which is why it's called a micro web framework.
- Pyramid: An open source minimalistic web framework inspired by Zope, Pylons and Django. It strictly adheres to the MVC (Model-View-Controller) pattern and persistence agnostic. Compared to Django, Pyramid provides an extra URL mapping mechanism called URL traversal which maps URLs to views through a predefined dictionary data structure.
- web2py: An open source macro web framework inspired by Ruby-on-Rails. It follows Ruby-on-Rails' convention over configuration approach and provides sensible defaults for various components and libraries. Compared to Django, web2py is different because it handles almost everything for a programmer while providing fewer configuration options.
Notice that there's no ranking between these frameworks. No matter which web framework you choose, at the end of the day the most important question is answered by yourself or your team: Do I enjoy using this framework? An enjoyable-to-use web framework brings out the highest efficiency of any programmer. Therefore, choose a framework you love and use it to create elegant web sites.
In this article, the landscape of web development and Django is presented under a bird's-eye view. In addition to learning the general basics of web development and Django, we compared Django with other Python web frameworks and concluded that no matter which framework you choose, you should choose one that you love to use.To Practice: Try this interactive course on the basics of Lists, Functions, Packages and NumPy in Python.