Book Image

Python 3 Web Development Beginner's Guide

By : Michel Anders
Book Image

Python 3 Web Development Beginner's Guide

By: Michel Anders

Overview of this book

<p>Building your own Python web applications provides you with the opportunity to have great functionality, with no restrictions. However, creating web applications with Python is not straightforward. Coupled with learning a new skill of developing web applications, you would normally have to learn how to work with a framework as well.</p> <p><em>Python 3 Web Development Beginner's Guide</em> shows you how to independently build your own web application that is easy to use, performs smoothly, and is themed to your taste – all without having to learn another web framework.</p> <p>Web development can take time and is often fiddly to get right. This book will show you how to design and implement a complex program from start to finish. Each chapter looks at a different type of web application, meaning that you will learn about a wide variety of features and how to add them to your custom web application. You will also learn to implement jQuery into your web application to give it extra functionality. By using the right combination of a wide range of tools, you can have a fully functional, complex web application up and running in no time.</p>
Table of Contents (19 chapters)
Python 3 Web Development Beginner's Guide
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Time for action – choosing a delivery framework, also known as web server


In the first section of this chapter, we showed that a web application lives in two realms at the same time, namely, on the server and on the client. In order to deliver information to the client and receive a response in return, our web application needs two important items at the server: a delivery framework and an application to compose content and respond to the request.

The delivery framework might be a full-fledged general purpose web server such as Apache or Microsoft Information Server, but although these are very versatile and come with many options to tune the web server to your specific needs, they certainly take quite some time to get acquainted with and it takes extra attention to integrate the dynamic content of your application with these servers. If performance is crucial or the requirements for your project include that your application has to be deployed as part of these servers, you may not have a choice, but otherwise its worth looking at the alternatives that are simpler to use or offer integration advantages.

So what do we need?

  • A fairly lightweight web server that is easy to configure and maintain

  • That allows for smooth integration of static and dynamic content

  • That comes with reusable components that ease the development process

  • That is actively maintained and developed

Given these requirements, our choice for delivery framework is CherryPy.

What just happened?

CherryPy fits the bill nicely. Its main advantages are:

  • CherryPy is written in Python and components that deliver dynamic content are written as Python classes that are tightly integrated with CherryPy's core.

  • CherryPy comes with a whole host of tools; reusable components that can be used to implement anything from custom error pages to session management.

  • CherryPy has a proven track record as the core web server of the larger TurboGears network.

  • And finally, CherryPy is actively developed and enjoys a large user community.

The disadvantage of being written in Python is that performance might not be top notch, but we will look into that in the next section.