Summary
This chapter was about deploying your Python code to production. We looked at the different factors that affect the deployability of a system. We went on to discuss the tiers in deployment architecture, such as the traditional four-tiered and the three- and two-tiered architectures, including combinations of development, testing, staging/QA, and production tiers.
We then went on to discuss the details of packaging Python code. We discussed the tools of PIP and virtualenv in detail. We looked at how pip and virtualenv can work together, and how to install a set of requirements using pip, and set up similar virtual environments using it. We also took a quick look at relocatable virtual environments.
We then went to discuss PyPI—the Python Package Index which hosts Python third-party packages on the web. We then went through a detailed example of setting up a Python package using setuptools and the setup.py
file. We used the mandelbrot application as an example in this case.
We...