Compare of Django and Turbogears - bernardopnunes/SoftwareEngineeringSDUW GitHub Wiki
The Hateful Eight
Django, pronounced [` d ʒ æ ŋ ɡ goes ʊ], is written in python open source web development framework, and follow the MVC design. The framework was developed by the Lawrence publishing group for the purpose of developing news-focused websites and was released under the BSD license in July 2005. The main purpose of Django is to make it easy and fast to develop a "database" driven web site. It emphasizes code reuse, and multiple components can easily serve the entire framework as "plug-ins." Django has many powerful third-party plug-ins, and you can even easily develop your own toolkit. This makes Django very extensible. It also emphasizes rapid development and DRY(DoNotRepeatYourself) principles.
Complete functions, complete elements: with a large number of common tools and frameworks (such as paging, auth, rights management), suitable for rapid development of enterprise-level website.
Well-documented: after more than a decade of development and development, Django has extensive practice cases and well-documented online offerings. When developers encounter a problem, they can search online documents for a solution.
Powerful database access components: Django's Model layer comes with a database ORM component that allows developers to manipulate databases without having to learn the SQL language.
Django's advanced App design concept: apps are pluggable and rare. Do not need, can be deleted directly, the overall impact of the system is not big.
Admin: a complete background data management and control platform can be implemented with a few simple lines of configuration and code.
Django debug is detailed: it's easy to find code errors.
It's all for you: Django is included for some lightweight applications that don't need it, and it's not as portable as Flask.
Over-encapsulation: many classes and methods are encapsulated, making it easier to use directly, but harder to change.
Performance disadvantage: compared with C and C++, Django's performance is low. Of course, this is a python pot, and other python frameworks will have the same problem when it comes to traffic.
Template issues: django's templates allow for a complete separation of code and style, and don't allow python code to appear in the templates, which may not be flexible enough for some programmers.
TurboGears is a great Web site development framework for the Python programming language. It is made up of a number of subprojects that help us bring together many important components to provide an integrated Web development framework for front-end to back-end Web development.
- Rapid development
- ROR mode
- Have certain time accumulation and corresponding development tools and modules
- Support Ajax, I18N
- Less development work
- Python language, fast installation and layout
TurboGears is made up of multiple projects, using multiple licenses. SQLObject (ORM tool) is protected with the LGPL (Lesser General Public License), which means that any direct modifications to SQLObject need to be contributed back to the project. This license does not require applications that use it to be open source. However, some companies will ban lgpl-protected software.
Django and TurboGears are MVC style frameworks that developers can use to quickly develop Web sites in the Python language. To choose the technology that best suits your needs, consider the following differences:
Background: *
Both projects, like Ruby on Rails, were extracted from existing applications and released to the open source community. Django has a long history, coming from an online newspaper service that served millions of page views a day. TurboGears was extracted from a fat client, the RSS News Reader application, which is still under development. TurboGears has a better community drive than Django because it is built on top of existing open source components.
The different backgrounds between the two projects lead to different project priorities. The Django project, which grew out of the rapidly changing world of online publishing, focuses on a framework that allows you to quickly build and modify content-based applications. The TurboGears project is based on a consumer product that focuses on fat-client applications and pluggable architectures.
- URLs:
TurboGears' request distribution mechanism is routed through controller classes and method names. After you add a new controller class or method, they automatically become available. If we need to modify the path to execute a given controller, we need to reconfigure the code structure. Instead, Django USES a separate regular expression-based configuration file to map the URL to the underlying code, reducing the coupling between the URL path structure and the actual implementation.
The TurboGears system is much faster to set up than Django because it only requires an expose operation to make the new page available. However, the Django configuration system provides maximum control and flexibility. After significant changes, Django urls can simply be remapped to the application. This helps prevent "link failures" due to old tabs or caching of search engine results. "Link failure" can have a significant impact on the level of communication and availability of content-based Web sites that Django is designed to create.
- code reuse:
The TurboGears team calls their project the big framework, which clearly expresses the idea that TG is a project made up of many existing components. Instead of writing from scratch, the TurboGears team selects and integrates the best open source code. Another advantage of the TurboGears framework is that it is a large project with many communities. TG is now very powerful and is driving interest and participation in the core components that make up TurboGears. This will raise all boats.
Django, on the other hand, was created in 2003, when the state of Python components was not as stable as it is today. The Django Web stack was created from scratch, and the end result is a stable framework that has been used to create multiple Web sites that handle millions of hits a day. However, some people have commented that the Django project might run into Not Invented Here problems due to a lack of code reuse. The Django team's position is that the work required to create a framework from scratch in Python is no more difficult than putting existing components together to eventually produce a more unified framework.
- JavaScript:
TurboGears starts by providing MochiKit, a JavaScript library, in its own framework. The team also created a widget library that takes advantage of JavaScript to create rich form elements. This shows how important fat client (Ajax) development is in the TurboGears world. The Django team did not choose to use a JavaScript library to include its own framework by default, but they have discussed the possibility. Neither project restricts our use of any JavaScript libraries.
- management tools:
Both projects have a management interface. Django administration tools are aimed at end users who need a good data entry tool so that you don't need to customize the tool every time you add new functionality to your application. The TurboGears administration tool, on the other hand, focuses on the needs of the developer: it provides a set of design tools, along with a basic database viewer and editor. permit:
Because Django was created from scratch, the entire project used an open source license (BSD license). TurboGears is made up of multiple projects, using multiple licenses. SQLObject (ORM tool) is protected with the LGPL (Lesser General Public License), which means that any direct modifications to SQLObject need to be contributed back to the project. This license does not require applications that use it to be open source. However, some companies will ban lgpl-protected software. In this case, we can consider using SQLAlchemy, another ORM tool that is strongly supported by the TG community.
- practical examples:
See resources for a list of known sites driven by Django and TurboGears. These actual applications show what we can do with each tool.
https://blog.csdn.net/Yaxing_Wang/article/details/82108434