We are 40% more affordable than other Hyperscalers! Sign up and avail $100 free credits now!!

AccuWeb.CloudAccuWeb.CloudAccuWeb.Cloud
Post Category: Blog > Products > Applications Cloud

Mezzanine CMS: Hosting with AccuWeb.Cloud

Mezzanine CMS (Content Management System) is an open source, powerful, and user friendly solution for managing content and blogs. Built on the Django framework, which is powered by Python, Mezzanine is available under the BSD license. Its default functionality covers a wide range of common needs, and its extensibility with third party extensions, widgets, modules, and themes allows for easy customization to meet specific requirements.

Mezzanine CMS offers numerous benefits for both developers and content managers, including:

  • User Friendly WYSIWYG Editor: Featuring drag and drop page ordering and visual content editing for intuitive site management.
  • Scheduled Publishing: Plan and automate content release with ease.
  • Variety of Themes: Access a wide selection of ready to use themes for quick customization.
  • Comprehensive API: Utilize a rich API for extensive development capabilities.
  • Built In Support: Seamless integration with Django internationalization, Twitter Bootstrap, Disqus, Akismet spam filter, Twitter feed, and Google Analytics.
  • Integrated Social Media and SEO: Built-in tools for social network integration, search engine optimization, and a wide range of additional modules.

In this article, we will explore how to host Mezzanine CMS on AccuWeb.Cloud.

Creating a Python Environment

To host Mezzanine CMS, you need a Python based application server with database server. Here’s how to create a new environment with an Apache Python node:

Step 1. Begin by logging into your AccuWeb.Cloud account. Once logged in and you will be directed to the main dashboard interface.

New Environment

Step 2. Locate and click the “New Environment” button situated at the top of the dashboard. This will open the topology wizard, allowig you to configure your new environment.

Step 3. In the topology wizard and navigate to the Python tab. Here, the Apache Python application server will be pre selected by default. Ensure that the Python version is 3.6 or later to maintain compatibility with Mezzanine CMS. If an older version is selected, update it to a compatible version.

Step 4. Depending on your project’s requirements, choose a database server. You can select either MySQL or PostgreSQL. Both options are fully supported by Mezzanine CMS.

Step 5. Configure Additional Settings (if necessary):

  • Cloudlet Limits: Set the cloudlet limits to define the resource allocation for your environment.
  • Public IP: Configure a public IP address if your project requires external access.

Step 6. Enter a unique and descriptive name to your environment for easy identification.

Step 7. After configurin’ all the necessary settings and click the “Create” button to initiate the creation of your new environment.

Create Environment

The system will begin setting up your environment. This process might take a few moments. Once completed, your new environment will appear on the dashboard and ready for further customization and deployment of Mezzanine CMS.

By following these steps, you will have successfully created a new Python based environment on AccuWeb.Cloud, suitable for hosting Mezzanine CMS.

Manual Deployment of Mezzanine CMS

Deploying Mezzanine CMS involves three primary steps: installation, database configuration, and starting the application.

Installation of Mezzanine CMS

Step 1. Access your server through the web SSH provided by AcccuWeb.Cloud.

Web SSH

Step 2. Running Python web applications in isolated virtual environments is a common practice. This allows managing project dependencies independently without requiring administrator privileges.

  • virtualenv virtenv
  • source virtenv/bin/activate

Manage Without Admin Privileges

Step 3. Use pip to install the Mezzanine content manager.


pip install mezzanine

Install Mezzanine

Step 4. Remove the default application in the ROOT context and install the Mezzanine project.


rm -rf ROOT
mezzanine-project ROOT

mezzanine-project ROOT

Database Configuration

Step 1. Log into your database admin panel using the credentials provided in the email sent after the DB node creation.

Login to Database Admin Panel

Step 2. Go to the User accounts tab and click “Add user account” to create a new account for Mezzanine CMS to access the database.

Add User Account

Step 3. On the new user page, enter the preferred username and password. Ensure you check the “Create database with same name an’ grant all privileges” checkbox.

Add Credentials

Step 4. Edit the local_settings.py file located at /var/www/webroot/ROOT/ROOT/local_settings.py to include your database credentials.


DATABASES = {
"default": {
"ENGINE": "django.db.backends.mysql",
"NAME": "mezzanine",
"USER": "mezzanine",
"PASSWORD": "passw0rd",
"HOST": "node5764-env-8733461.us-accuweb.cloud",
"PORT": "3306",
}
}

Local Settings

Adjust the ENGINE, NAME, USER, PASSWORD, HOST, and PORT fields accordingly.

Step 5. Install the MySQL connector for Python.


pip install mysqlclient

Install MySQL connector

Note: To install the Python connector for the PostgreSQL database, use the `pip` package manager to get the `psycopg2` module. Run the following command:

PATH=$PATH:/usr/pgsql-9.6/bin/ pip install psycopg2

If you are using a different version of PostgreSQL, replace `pgsql-9.6` with the appropriate version number in the command.

Starting Mezzanine CMS

Create Application Database Schema:

Step 1. Enter the ~/ROOT folder and run the manage.py script.


cd ROOT
python manage.py createdb noinput

Create Database Schema

Step 2. Modify the wsgi.py file at /var/www/webroot/ROOT/ROOT/wsgi.py to include the following configuration.


import os,sys
virtenv = os.path.expanduser('~') + '/virtenv/'
virtualenv = os.path.join(virtenv, 'bin/activate_this.py')
try:
if sys.version.split(' ')[0].split('.')[0] == '3':
exec(compile(open(virtualenv, "rb").read(), virtualenv, 'exec'), dict(__file__=virtualenv))
else:
execfile(virtualenv, dict(__file__=virtualenv))
except IOError:
pass
sys.path.append(os.path.expanduser('~'))
sys.path.append(os.path.expanduser('~') + '/ROOT/')
sys.path.append(os.path.expanduser('~') + '/ROOT/ROOT/')
os.environ['DJANGO_SETTINGS_MODULE'] = 'ROOT.settings'
from django.core.wsgi import get_wsgi_application
from mezzanine.utils.conf import real_project_name
application = get_wsgi_application()

Modify The wsgi.py File

Step 3. Save your changes.

Step 4. Create a symlink to the WSGI file and collect static content.


ln -sfT ~/ROOT/ROOT/wsgi.py ~/ROOT/wsgi.py
python manage.py collectstatic

Create a Synlink

This will store the application static content in the ~/ROOT/static directory.

Step 5. Edit the local_settings.py file to adjust the ALLOWED_HOSTS settin’.


ALLOWED_HOSTS = ["{envDomain}"]

Step 6. Replace {envDomain} with your environment’s domain name.

Step 7. Click the “Open in Browser” button next to your environment to access Mezzanine CMS.

Open in Browser

The welcome page should open by default.

Welcome Page

Log in to the Admin Interface

Follow the “Log in to the admin interface” hyperlink to access the admin panel. Log in using the default admin credentials (admin/default).

Login to Admin Interface

Tip: For security reasons, it is recommended to change the default password immediately after the first login.

Change Password

Conclusion

Hosting Mezzanine CMS on AccuWeb.Cloud PaaS provides a robust and scalable solution for your content management needs. The platform’s integration with Python, and Django, along with its extensive list of features and customization options, makes it a powerful tool for developers and content managers alike.

By following the steps outlined in this article, you can easily set up and deploy Mezzanine CMS on Accuweb Cloud. The process involves creating a Python environment, installing Mezzanine, configuring the database, and starting the application. Once set up, you can take advantage of Mezzanine’s rich feature set and flexibility to create a dynamic and engaging online presence.