liveBook · Manning

Production

As explained in Build Python Web Apps with Streamlit

A deployment environment is an isolated live or pre-live instance of an application with its own resources and configuration.

An app running on your laptop is useful for development, but other people need a deployed version they can reach. That live version runs in a production environment, often called prod. Development and production are separate environments, so a change that works locally may still fail after deployment. section 5.0 section 5.4.1

Keep the code and Python dependencies compatible across both environments. For example, a to-do app can fail in prod if it uses a feature of requests that the installed production version lacks. A requirements.txt file tells pip which libraries and versions to install; Streamlit Community Cloud installs from that file when it is in the GitHub repository. section 5.4.1

Listing 5.5 A strict requirements.txt file
requests==2.31.0
streamlit==1.34.0

These exact version pins show one way to reduce differences between development and production dependencies. section 5.4.1

For more control, a Streamlit app can be packaged with Docker and deployed to AWS. In Elastic Beanstalk, an application groups environments: it might contain both production and staging. The EB CLI uses eb init to configure the application, eb create to deploy an environment, and eb deploy to send a later version to the running environment. section 12.0 section 12.3.6

Creating a live environment

During eb create, name an environment fact-frenzy-prod. A successful launch reports an application URL; after changes, eb deploy updates the running instances. Before sharing that URL, check dependencies and safeguard secrets such as API keys. section 12.3.6 section 5.0

How Build Python Web Apps with Streamlit covers it

How deep it goes
Explains dependency compatibility and walks through Elastic Beanstalk environment creation and redeployment, without detailing runtime internals.
Examples
Uses a to-do app’s requests version mismatch and a named Elastic Beanstalk production environment.
What it assumes
Assumes an existing Python app while introducing development–production differences and guided EB CLI setup.
What you can do after
Operate/configure it with the EB CLI to create a production environment and deploy later application versions.
How it connects
Links production to development environments, staging environments, Python dependencies, and Elastic Beanstalk.

Also explained in

Compare how 8 books explain production →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Build Python Web Apps with Streamlit. The section links point to the parts of the book it draws on.