Django CMS is a free open-source content management system based on the Django web framework, which ensures a quick integration of the databases and new modules. Django CMS helps to simplify the process of creating complex websites due to its intuitive and easy-to-learn drag and drop interface. Simultaneously, it is powerful and expandable enough to satisfy the most demanding content editors.
Below, we’ll overview the steps required to automatically or manually install the Django CMS solution to the cloud.
Django CMS Automatic Installation
You can automatically get a preconfigured ready-to-work Django CMS instance up and running within minutes using Jelastic Marketplace.
Tip: If you don’t have an account, you can automatically get it and, simultaneously, initiate Django CMS solution installation by clicking the button below and fulfilling the form within the opened page.
1. Log in to your Jelastic account and click the Marketplace button at the top of the dashboard.
2. Search for the DjangoCMS solution in the opened window.
Hover over the located package and click Install.
3. Within the appeared installation frame, you can adjust the following fields:
4. That’s it! In just a few minutes your Django CMS application will be installed.
Use the info within the pop-up to access your Django CMS home and admin panel pages.
Django CMS Manual Installation
You can deploy Django CMS manually with the help of the following step-by-step instruction and take the complete control over the process.
Let’s start by creating an environment for the Python applications hosting. To do this, follow the next steps:
1. Click the New environment button.
2. Navigate to the Python programming language tab, where the Apache application server will be selected automatically. State the resource limits, choose the region (if available) and enter the name (e.g. django-cms) for your environment.
Currently, the Django CMS does not supportPython 3.7, so select the version appropriately.
Django CMS requires a database for work; herewith, you can use:
SQLite is implemented by default and does not require any additional configurations (data is stored locally on the same container as your application); this solution is suitable for the development and testing purposes
external SQL database (e.g. MySQL or PostgreSQL) is a secure and reliable option to be used for the production environments
Finally, click Create at the bottom right corner of the frame.
3. Just in a minute, your environment will appear at the dashboard.
Now, you can install Django CMS from scratch or deploy your existing application into the environment. We’ll check both these options one-by-one.
Install Django CMS
1. Connect to your application server via Web SSH:
2. You should create an isolated virtual Python environment for your application, using the virtual environment tool, which allows managing projects’ dependencies independently and without the administrator privileges:
3. Activate and switch to the newly created virtual environment by executing the next command:
4. Install the Django CMS installer using the pip package manager:
pip install djangocms-installer
Wait a minute for the operation to be completed.
5. Next, remove the pre-installed application and create a new Django CMS application:
rm -rf ROOT
djangocms -p . ROOT -s
Tip: You can read more about Django CMS installer arguments at the official documentation. For example, use the -w option to enable wizard mode installation and manually define various specific settings.
6. Edit the mod_wsgi module (the /var/www/webroot/ROOT/wsgi.py file) by replacing its content with the lines below:
Note: The ALLOWED_HOSTS option contains a list of strings representing the domain names, which this Django site can serve (django-cms.jelastic.com in our case). Also, can be set as * to match any host.If using an external database, the connection details should be specified within the DATABASES section, where:
ENGINE – change the database type (django.db.backends.mysql for the MySQL database or django.db.backends.postgresql_psycopg2 for PostgreSQL)
NAME, USER, PASSWORD – provide the data on the dedicated DB and account to connect
HOST – get the value from the email received after DB creation
PORT – set the port (3306 for MySQLor 5432 for PostgreSQL)
Don’t forget to Save the changes.
8. Create new subdirectories for the static/media content and run the synchronization of resources: mkdir ROOT/static_local
python manage.py collectstatic
9. That’s all! Now, you can access your environment by clicking Openin Browser.
Within the opened page log in to the admin panel using the default admin/admin credentials.
Here, you can immediately start working by creating your first page with Django CMS.
Deploy Existing Django Application
In case you have already the previously built and packaged Django application, the deployment procedure can be performed just in a few steps.
Note: If configuring own deployment archive, please ensureyour Django package contains the following files in its root:
requirements.txt file with the names of all the Python modules your application requires, it will be read by the deployment script to install the listed modules via the pip manager automatically
wsgi.py file with the entry point script for running your application inside a virtual environment using the mod_wsgi for Apache