1. For the new Django application to be set up, you need to access your Apache application server via the Jelastic SSH Gateway first.
In case you haven’t performed similar operations before, you need to:
2. After entering the container you should create a virtual environment for your application inside. In such a way, you’ll get an isolated Python environment and the ability to install packages without having the administrator privileges:
3. Activate and switch to the newly created virtual environment by executing the next command:
4. Now, let’s get and run the Django CMS installer script using the pip package manager:
pip install djangocms-installer
Wait a minute for the operation to be completed.
5. Then, you need to delete the preinstalled by default application and create a new Django CMS app:
rm -rf ROOT; djangocms -w -p . ROOT -s
6. After executing the abovementioned command, you will see a set of questions, which will help you to define the settings of your new application.
Let’s pay a special attention to the database configuration step:
Note that Django version 1.7 and below is incompatible with Python 3.5, thus you should set it equal to 1.8 or higher in this case (or just use the stable one)
Complete the remaining wizard steps by entering your custom values or leaving the default ones (displayed at the end of strings in the square brackets).
7. When the application is configured, you’ll be asked to specify Username, Email and Password for your CMS administrator (superuser):
8. Next, enter the vim ROOT/wsgi.py command to edit the file with the mod_wsgi module entrypoint set. Replace this file content with the lines below:
virtenv = os.path.expanduser('~') + '/virtenv/'
virtualenv = os.path.join(virtenv, 'bin/activate_this.py')
if sys.version.split(' ').split('.') == '3':
exec(compile(open(virtualenv, "rb").read(), virtualenv, 'exec'), dict(__file__=virtualenv))
sys.path.append(os.path.expanduser('~') + '/ROOT/')
os.environ['DJANGO_SETTINGS_MODULE'] = 'ROOT.settings'
from django.core.wsgi import get_wsgi_application
application = get_wsgi_application()
Save the made changes and exit the vim editor.
9. Then, create a symlink, that points to the file we’ve modified above, by executing the following line:
ln -sfT ~/ROOT/wsgi.py ~/ROOT/application
10. Finally, let’s link the static data. For that, perform the following steps:
enter the vim ROOT/settings.py command. In the opened file, find and adjust the values of the ALLOWED_HOSTS, MEDIA_ROOT, STATIC_ROOT and STATICFILES_DIRS parameters:
ALLOWED_HOSTS = ['*']
MEDIA_ROOT = os.path.join(DATA_DIR, 'ROOT', 'media')
STATIC_ROOT = os.path.join(DATA_DIR, 'ROOT', 'static')
STATICFILES_DIRS = (
os.path.join(BASE_DIR, 'ROOT', 'static_local'),
Note: ALLOWED_HOSTS can contain a list of strings representing the host/domain names that this Django site can serve. In the example, we use a value of '*' that will match any request’s Host header. However, you can specify a fully qualified name (not including port) or a value beginning with a period (e.g. .jelastic.com) as a subdomain wildcard.
Save the changes and exit vim.
- create new subdirectories for the static and media content:
mkdir ROOT/static_local; mkdir ROOT/media
- and, lastly, run the synchronization of resources:
Enter yes if system asks for confirmation and wait till this process is over.
11. That’s all! Now, you can return to the dashboard and press Open in browser button next to your environment with Django CMS.
As a result, you will see the application’s welcome page.
Tip: You can access the Django CMS administration panel by adding /admin at the end of the page’s URL. For entering, use the superuser credentials you’ve specified while creating your Django CMS application.