Django CMS and Python-Based Cloud Hosting with Jelastic PaaS

36

3211-1-python-logoFrom the very beginning, Jelastic PaaS was architectured as a polyglot platform starting with Java, and followed by PHP and Ruby. Python has also been added to the supported language family, and with this article we’d like to pay more attention to Python cloud hosting with Jelastic PaaS and provide a live sample of a Django CMS (Python application) deployment.

Python Versioning

Jelastic PaaS supports Apache application server for hosting Python applications. It is implemented by means of the Apache + mod_wsgi bundle.

The following Python versions are supported:

  • 2.7.15;
  • 3.4.9;
  • 3.5.6;
  • 3.6.7;
  • 3.7.1.

All of these versions are pre-installed in each Python container. A user can choose the required version during environment creation or change it afterwards via the environment topology wizard. The workflow is described in the Python versions documentation.

3211-1-python-environment-versions

Python Application Deployment

You can easily deploy an already packaged Python application via:

Please notice that you can deploy just one Python application to an environment, so it will be in the ROOT context by default. You can also use the SSH Access feature for building and deploying a new custom application.

Note: In order to deploy your own package, its ROOT should contain the following files:

  • requirements.txt – file with the names of all Python modules your application requires;
  • application – file with the entry point script for running your application using Apache mod_wsgi considering your virtual environment.

Packages and Modules Management

In order to successfully deploy and run a Python application, some additional modules or other packages may required to be installed. The management of the required software packages is provided by pip, a popular Python package management system.

There are two ways to download and install necessary Python modules:

  • Write a list of required modules in the requirements.txt file, located in the root of your project package, in order to be read by a deployment script to install these modules automatically with the help of pip;
  • Connect to your container via SSH Access and operate with the following commands:
    • pip install {package_name} – to install a necessary module;
    • pip uninstall {package_name} – to remove previously installed module;
    • pip install –upgrade {package_name} – to update the specified module to the latest version;
    • pip install -r requirements.txt – to install all the modules, listed in the requirements.txt file;
    • pip list – to see the list of already installed modules.

Using additional commands and their attributes you can also specify the preferred module version, configure resolving of relative dependencies, show details on installed modules or search for the necessary ones in the PyPi packages repository. To find out more details on the commands you can use, navigate to the pip user guide.

Logs Monitoring

Jelastic PaaS makes the following log files available for Python WSGI:

  • access_log-{date};
  • error_log-{date}.

These log files can be seen by clicking on the Log button next to the Apache application server in the environment. Here, you can monitor all the actions performed within your Python environment.

Available Frameworks

Jelastic PaaS supports the following Python frameworks:

  • Django;
  • Flask.

You can deploy different Python applications based on these frameworks. Read the documentation in order to set your own Quokka CMS application (Flask-powered application) in Jelastic PaaS. And below, we will describe how to deploy and run Django CMS.

Django CMS Deployment

You can automatically get a preconfigured ready-to-work Django CMS instance up and running within minutes using Jelastic PaaS Marketplace.

1. Log in to your Jelastic PaaS account and click the MARKETPLACE button at the top of the dashboard.

3211-1-dashboard-marketplace-button

2. Search for the DjangoCMS solution in the opened window.

3211-1-install-django-cms-from-marketplace

Hover over the located package and click Install.

3. Within the appeared installation frame, you can adjust the following fields:

  • Environment – set your environment name;
  • Display Name – define a preferable alias;
  • Region – select the environment region (if available).

3211-1-install-options-django-cms-from-marketplace

Proceed with the Install button.

4. That’s it! In just a few minutes your Django CMS application will be installed.

3211-1-django-cms-deployed

Use the information within the pop-up to access your Django CMS home page and admin panel pages.

You can deploy Django CMS manually following the linked step-by-step instruction to take full control over the deployment process.

Conclusion

We are very excited to provide you Python cloud hosting in Jelastic PaaS, with the features and flexibility to develop, to host and to scale complex Python applications without vendor lock-in. Start now for free and try the beneficial features of Python cloud hosting at our Jelastic PaaS platform.

SOURCEJelastic, Inc.