Python: Deploying to staging environment
This documentation is part of the Advanced usages guide. View the full guide here: Going further with your Python deployments.
👋 Welcome to the Stackhero documentation!
Stackhero provides a ready-to-use Python cloud solution designed to streamline your deployment process:
- Deploy your application to production in seconds with a simple
git push.- Use your own domain name, with automatic HTTPS certificate configuration for secure connections handled for you.
- Rely on automatic backups, one-click updates, and predictable pricing, so you can focus on your code, not infrastructure management.
- Benefit from strong performance and security on a private, dedicated infrastructure. Your environment is isolated and protected.
Save time and simplify your workflow: you can have your code running with Stackhero's Python cloud hosting in just 5 minutes.
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.