Python Cloud Hosting - New Togglebox Services - Togglebox Blog

Python Cloud Hosting

  • 0

Togglebox is partnering with Jelastic PaaS to provide Python-based applications hosting.

Optimized for immediate management, there is no need to bother with orchestration tasks, making the hosting process maximally convenient for developers.

Learn more about the main tools and features available:

Python Environment Hosting

Create the appropriate environment via the powerful topology wizard:

  1. Switch to the Python language tab
  2. Select the desired engine version.

Apache Python is automatically added in a bundle with the mod_wsgi module.

3. Specify resource limits and nodes’ count.
4. Add  software stacks or Public IPs if required.

create Python environment

 Isolated containers are fully independent.
Distribution is automatic across available hosts ensuring high availability.

Python Versions:

You can easily switch between different versions of Python. Keep up-to-date with this list of the releases updated weekly: Software Stack Versions

Python versions

Select the required version of Python and adjust it for already existing ones using container redeployment.

Python Application Deployment

Deployment (Apache Python) is automated and can be performed using one of the following flows:

  • from remote VCS repository (e.g. GitHub)
  • via application archive uploaded by external URL or from the local machine

deploy Python application

Git flow can use sequential or simultaneous deploy, as well as automatic re-deployment if new code changes appear.

Here is a detailed overview of the deployment process and the provided additional options:

As well as examples of the Python-based application hosting:

Python Packages and Modules Management

Additional modules or other packages may be required to be installed.

It is a common practice to run Python web applications in isolated virtual environments, by using the virtual environment tool, which allows managing projects without administrator privileges.

1. Go to Settings > SSH > Web SSH and run the following commands:

virtualenv {appName}

source {appName}/bin/activate

Python virtual environment

2. The management uses pip – a popular Python package management system for the PiPI repository.

Here are the most common commands used:

  • pip install {packageName} – installs a necessary module
  • pip uninstall {packageName} – removes previously installed module
  • pip install -upgrade {packageName} – updates the specified module to its latest version
  • pip install -r requirements.txt – installs all the modules, listed in the requirements.txt file
  • pip list – shows the set of already installed modules
Tip: In case of the preconfigured application packages (archives), all the dependencies are provided via the requirements.txt file. Also, it should contain the wsgi.py file with the entry point script for running an application inside a virtual environment using the mod_wsgi for Apache.

Domains Management

The default domain name of your Python application can be replaced with a custom one:

  • CNAME redirect if using Shared Load Balancer; is recommended for dev and test environments
  • DNS A Record if using Public IP; can handle high traffic load and is suitable for production environments

custom domain for Python application

You can switch traffic between two environments quickly and without downtime using the swap domains functionality or with the help of the SwapExtIps API/CLI method.

Automatic Vertical Scaling

Automatic vertical scaling provides the exact amount of resources (RAM and CPU) that your application requires.

No need to waste time continuously making load-related adjustments.

The Pay-as-You-Use pricing model ensures you never overpay for unused resources.

Just set the upper cloudlets limit (each one equals 128 MiB of RAM and 400 MHz of CPU)

Everything else is automated.

automatic vertical scaling of Python application

Refer to the automatic vertical scaling guide for additional details.

Manual Horizontal Scaling

Specify the required number of nodes with the +/ buttons in the central part of the topology wizard.

Choose the preferred scaling mode:

  • Stateless – simultaneously creates all of the new nodes from the base image template
  • Stateful – sequentially copies file system of the master container into the new nodes

horizontal scaling Apache Python

load balancer instance is automatically added to the environment upon Python server scaling.
Refer to the horizontal scaling documentation for more specifications.

Automatic Horizontal Scaling

Go to Settings > Monitoring > Auto Horizontal Scaling section to set up custom triggers, which  increase/decrease the number of nodes due to the application load.

Choose a resource type to be monitored (CPURAMNetworkDisk) and the correct scaling.

Everything is automated.

You will be emailed when your changes are enabled.

automatic horizontal scaling of Python application

Database Connection to PHP Application

A set of scalable and fully manageable database servers are available in the Python environment.

Adjust your application based on the database you require:

Her is a list of other built-in tools and features:

  • Custom or Let’s Encrypt SSL
  • Public IPv4 and IPv6
  • A wide range of managed software stacks
  • Container firewalls, endpoints, and environment isolation
  • User-friendly UI and direct Web SSH access for management
  • Open API and Cloud Scripting for automation
  • Pay-as-you-use pricing model
  • Collaboration functionality for teamwork
  • Multi-cloud distribution