Book Image

Hands-On Enterprise Application Development with Python

By : Saurabh Badhwar
Book Image

Hands-On Enterprise Application Development with Python

By: Saurabh Badhwar

Overview of this book

Dynamically typed languages like Python are continuously improving. With the addition of exciting new features and a wide selection of modern libraries and frameworks, Python has emerged as an ideal language for developing enterprise applications. Hands-On Enterprise Application Development with Python will show you how to build effective applications that are stable, secure, and easily scalable. The book is a detailed guide to building an end-to-end enterprise-grade application in Python. You will learn how to effectively implement Python features and design patterns that will positively impact your application lifecycle. The book also covers advanced concurrency techniques that will help you build a RESTful application with an optimized frontend. Given that security and stability are the foundation for an enterprise application, you’ll be trained on effective testing, performance analysis, and security practices, and understand how to embed them in your codebase during the initial phase. You’ll also be guided in how to move on from a monolithic architecture to one that is service oriented, leveraging microservices and serverless deployment techniques. By the end of the book, you will have become proficient at building efficient enterprise applications in Python.
Table of Contents (24 chapters)
Title Page
Copyright and Credits
About Packt
Contributors
Preface
Index

Optimizing the frontend


Until now, we learned about the various issues that may hamper the performance of the frontend. Now, it's time to take a look at how we can reduce the performance impact on the frontends and make them fast and responsive in an enterprise grade environment.

Optimizing resources

The first and foremost optimization that we are going to take a look at is the optimization of resources that a particular page loads when it is requested. For this, consider the following code snippet from the user data display page in the admin panel, which is responsible for displaying a table of users in the database:

<table>
{% for user in users %}
  <tr>
    <td class="user-data-column">{{ user.username }}</td>
    <td class="user-data-column">{{ user.email }}</td>
    <td class="user-data-column">{{ user.status }}</td>
  </tr>
{% endfor %}
</table>

So far, so good. As we can see, the code snippet just loops over a user's object and...