Django IS plain Python. Thus, the execution time of each such statement or expression will be the same. What you need to understand is that many components come together to offer several advantages when developing for the Internet:
- Removing common tasks in libraries (auth, data access, templating, routing)
- Correctness of algorithms (cookies / sessions, cryptography)
- Reduced user code (due to libraries) that directly affects the number of errors, dev time, etc.
- The following conventions lead to improved teamwork and code understanding.
- Plug-in ability; Create or find new function blocks that can be used with minimal integration costs.
- Documentation and assistance; many people understand the technology and can help (StackOverflow?)
Now, if you have to write your own website from scratch, you will need to implement at least a few components yourself. You will also lose most of the above benefits if you do not spend time developing your site. Django and other web frameworks for every other language are designed to provide common material and allow you to work directly with business requirements.
If you ever deleted the user session code and data access code in PHP before the advent of web frameworks, you won’t even think about the cost of performance associated with the framework, which makes your work interesting and eas (y) ier.
Now, saying that Django comes with a lot of components. It is designed in such a way that most of the time they will not affect you. However, amazing code is executed for each request. If you build a site with Django, and performance just doesn't cut it, you can freely remove all the bits you need. Or you can use the "thin" structure of python.
Indeed, just use Django. This is amazing. It forces many sites millions of times more than anything you (or I) create. There are ways to significantly improve performance, for example, by using caching rather than optimizing the loop over custom middleware.
source share