Python: Deploying to staging environment
This documentation is part of the Advanced usages guide. You can view the complete guide here: Going further with your Python deployments.
👋 Welcome to the Stackhero documentation!
Stackhero offers a ready-to-use Python cloud solution that provides a host of benefits, including:
- Deploy your application in seconds with a simple
git push.- Use your own domain name and benefit from the automatic configuration of HTTPS certificates for enhanced security.
- Enjoy peace of mind with automatic backups, one-click updates, and straightforward, transparent, and predictable pricing.
- Get optimal performance and robust security thanks to a private and dedicated VM.
Save time and simplify your life: it only takes 5 minutes to try Stackhero's Python cloud hosting solution!
Maintaining separate staging and production environments is highly recommended. To manage multiple environments, start by renaming the current remote repository. For example, rename the remote stackhero to stackhero-production with:
git remote rename stackhero stackhero-production
Next, create a new Python service for your staging environment. Retrieve the git remote add command and modify it by replacing <XXXXXX> with your service's domain:
-
Original command:
git remote add stackhero ssh://stackhero@<XXXXXX>.stackhero-network.com:222/project.git -
Modified command:
git remote add stackhero-staging ssh://stackhero@<XXXXXX>.stackhero-network.com:222/project.git
You can then deploy to either environment using the following commands:
-
Deploy to staging:
git push stackhero-staging main -
Deploy to production:
git push stackhero-production main
To enhance the deployment process, we suggest utilizing the improved Makefile version.
With this improved
Makefile, deploying to production or staging becomes as simple as runningmake deploy-productionormake deploy-staging.