Compare Django and TurboGears
Django is Python web framework that encourages rapid development. It is based model-template-view (MTV) design pattern. It follows a "batteries included" philosophy and ships with many tools that are needed by application developers such as ORM framework, admin panel, directory structure and more.
TurboGears was born as a full stack layer on top of Pylons, and many other disparate libraries and middleware. It is now a standalone WSGI web framework designed around MVC architecture inspired by Ruby on Rails and provides all the features developes need for web development. It can also run in minimal mode and act like a microframework such as Flask.
Let's see how Django and TurboGears compare on various factors and features and which to choose when.
Python all-inclusive, megaframework for building web application.
A full-stack web application framework for Python.
Used by 367,000 projects.
Instagram, Pinterest, Coursera, Udemy.
2074 job openings which list Django as a requirement.
3 job openings which list TurboGears in the job description.
Not as fast as compared to bare-bones Flask or other microframeworks, but for many real-world use cases, the difference is negligible.
Not as performant
as barebones or even fullstack frameworks. Extensions could impact performance adversely.
Django expects things to be done in a certain way unlike microframeworks (e.g. Flask) which have no opinion on how developers structure things. However, It does this without compromising on flexibility. Django has been used to build a variety of things from content management systems to social networks to scientific computing platforms.
Developers can use TurboGears as a microframework which is very flexible. However, as you start building towards a fullstack solution, it does expect things to be done in a certain way.
Ease of Learning
Has a learning curve especially for those who are not familiar with other web frameworks. But there are some great online resources, courses tutorials and YouTube videos.
Ease of Learning
Has a learning but since it uses a lot of exisitng 3rd party libraries it becomes are little easier to onboard. It also has a decent amount of tutorials online.
Django ships with a built-in ORM framework
for developers to start using out of the box.
Verdict ORM is one of the best features of Django, loved by developers.
NoSQL databases are not officially supported by Django. There are open source projects like PynamoDB
or Django MongoDB Engine
, Django non-rel
to support NoSQL. Some of these extensions support specific Django versions and don't interplay
well with Django ORM.
Verdict Using NoSQL database with Django is not recommended.
Supports MongoDB out of the box using Ming ORM
. Ming ORM was developed to look like SQLAlchemy so it's easier for developers familiar with SQLAlchemy to start using it.
Django ships with a web-based admin site that has a friendly UI. It allows you to quickly perform CRUD operations against your models from your browser to test things out.
Built-in admin panel.
While not built-in, REST development is supported via the popular and active Django REST Framework
project. It provides support for API versioning, Browsable API
for interacting with APIs through web browser, authentication (OAuth1 and OAuth2) and serialization support for both ORM and non-ORM sources.
Built-in protection against several common attack vectors like CSRF, XSS, and SQL injection. When vulnerabilities are discovered, the Django team has an excellent security policy
are released quickly.
Little built-in protection. Must be handled by developers themselves or by using 3rd party extensions.
Ships with internally developed Kajiki templating engine, but supports multiple templating engine including Genshi
Ships with built-in ModelForms
which provides complete support for web forms including input validation, CSRF, XSS, and SQL injection.
TurboGears relies on ToscaWidgets2
for building and validating forms.
, authorization, account management and support for sessions.
Ships with repoze.who which is an authentication and identity framework for WSGI applications. Read more here
Built-in support using Python's unittest
If you found this useful, please help us grow by sharing this article with your followers using the sharing icons. Every share or call out will help. Thank you.