Introduction
Mezzanine CMS is an open-source CMS (Content Management System) primarily used for developing modern websites, and it is based on the Django framework. It is powerful, with an intuitive interface for managing a variety of content types. Some popular features are:
- WYSIWYG editing capabilities.
- Drag-and-drop HTML5 form builder and page ordering.
- In-line page editing.
- Blogging engine.
- Scheduled publishing.
- CSV data export.
- E-commerce/Shopping cart module.
- One-step migration from other blogging engines.
- Over 35 languages
- Multi-lingual sites
All the listed functionalities are available by default, and you don't need any additional modules or add-ons to use them. In this article, you will learn how to install Mezzanine CMS on Ubuntu 20.04 server.
Prerequisites
- Deploy a fully updated Rcs Ubuntu 20.04 Server.
- Create a non-root user with sudo access.
1. Install Python
Update your server packages.
$ sudo apt updateInstall Python 3 and pip3.
$ sudo apt install python3 python3-pip python3-dev -yVerify the Python installation.
$ python3 -VVerify pip3 installation.
$ pip3 -V2. Install and Configure MySQL Database
Install the MySQL database server.
$ sudo apt install mysql-server -yCheck the status of MySQL service.
$ sudo systemctl status mysqlEnable automatic running of MySQL service upon system reboot.
$ sudo systemctl enable mysqlLog in to MySQL shell. At the password prompt, just press Enter to continue.
$ sudo mysql -u root -pCreate a MySQL database named mezzanine.
CREATE DATABASE mezzanine CHARACTER SET UTF8;Create a database user named mezzanine with a password. Change StrongPassword to a strong password.
CREATE USER mezzanine@localhost IDENTIFIED BY 'StrongPassword';Grant the user full access to the database.
GRANT ALL ON mezzanine.* TO 'mezzanine'@'localhost' WITH GRANT OPTION;Flush the database privileges to save the changes.
FLUSH PRIVILEGES;Exit MySQL shell.
EXIT;3. Set up Python Virtual Environment
Install the Python Virtual Environment.
$ sudo pip3 install virtualenvCreate a Mezzanine user.
$ sudo adduser mezzanineAdd the user to the sudo group.
$ sudo usermod -aG sudo mezzanineLog in as the mezzanine user.
$ su - mezzanineCreate a new Virtual Environment.
$ virtualenv mezzanineActivate the virtual environment.
$ source mezzanine/bin/activate4. Install and Configure Mezzanine CMS
Install the Mezzanine CMS in the new virtual environment.
$ pip install mezzanineCreate a new Mezzanine App/Project.
$ mezzanine-project my_projectNavigate to the project directory.
$ cd my_projectEdit the settings file setting.py to define the database server for the application.
$ sudo nano my_project/settings.pyModify the following code in the Databases section and ensure you modify StrongPassword with your password, then save and close the file:
DATABASES = {
"default": {
"ENGINE": "django.db.backends.mysql",
"NAME": "mezzanine",
"USER": "mezzanine",
"PASSWORD": "StrongPassword",
"HOST": "localhost",
"PORT": "3306",
}
}Migrate the database schema.
$ python manage.py makemigrations
$ python manage.py migrateCreate a system administrator.
$ python manage.py createsuperuserEdit local_settings.py and modify hosts.
$ sudo nano my_project/local_settings.pyThe following line should look as shown, add your server IP address to the array, for example, 192.0.2.10. Then, save and close the file:
ALLOWED_HOSTS = ["localhost", "127.0.0.1", "::1", "192.0.2.10"]Run the Mezzanine server.
$ python manage.py runserver 0.0.0.0:80005. Access Mezzanine CMS Web Interface
To access the Mezzanine CMS Web Interface, go to your browser and visit http://Server_IP:8000. For example:
http://192.0.2.10:8000Conclusion
You have successfully installed Mezzanine CMS on your server and can access the main Dashboard. You can now log in and begin developing your websites.
More Information
To learn more about using Mezzanine CMS, go to the official documentation page.