This document assumes you are familiar with Python and Django. It should outline the steps necessary for you to follow the Introductory Tutorial.
Note
When installing the django CMS using pip, Django, django-mptt django-classy-tags, django-sekizai, south and html5lib will be installed automatically.
These packages are not required, but they provide useful functionality with minimal additional configuration and are well-proven.
django-reversion 1.6.6 (with Django 1.4.5), 1.7 (with Django 1.5) or 1.8 (with Django 1.6) to support versions of your content (If using a different Django version it is a good idea to check the page Compatible-Django-Versions in the django-reversion wiki in order to make sure that the package versions are compatible.)
Note
As of django CMS 2.4, only the most recent 25 published revisions are saved. You can change this behaviour if required with CMS_MAX_PAGE_PUBLISH_REVERSIONS. Be aware that saved revisions will cause your database size to increase.
Warning
As django CMS 3.0 is still unreleased, you need to pick it from the github repository. Use
pip install https://github.com/divio/django-cms/archive/3.0.0.beta3.zip
to install django CMS 3.0 beta3 or:
pip install https://github.com/divio/django-cms/archive/develop.zip
to target the development branch.
Installing inside a virtualenv is the preferred way to install any Django installation. This should work on any platform where python in installed. The first step is to create the virtualenv:
#!/bin/sh
sudo pip install --upgrade virtualenv
virtualenv --distribute --no-site-packages env
Note
Since virtualenv v1.10 (2013-07-23) –distribute or –setuptools are the same because the new setuptools has been merged with Distribute. Since virtualenv v1.7 (2011-11-30) –no-site-packages was made the default behavior. By the way, we can create a virtualenv typing in our console only virtualenv env.
You can switch to your virtualenv at the command line by typing:
source env/bin/activate
Next, you can install packages one at a time using pip, but we recommend using a requirements.txt file. The following is an example requirements.txt file that can be used with pip to install django CMS and its dependencies:
# Bare minimum
django-cms==3.0
#These dependencies are brought in by django CMS, but if you want to
# lock-in their version, specify them
Django==1.6.1
django-classy-tags==0.4
South==0.8.4
html5lib==1.0b1
django-mptt==0.6
django-sekizai==0.7
six==1.3.0
djangocms-admin-style==0.1.2
#Optional, recommended packages
Pillow==2.0.0
django-filer==0.9.5
cmsplugin-filer==0.9.5
django-reversion==1.7
Note
In the above list, packages are pinned to specific version as an example; those are not mandatory versions; refer to requirements for any version-specific restriction
for Postgresql you would also add:
psycopg2==2.5
and install libpq-dev (on Debian-based distro)
for MySQL you would also add:
mysql-python==1.2.4
and install libmysqlclient-dev (on Debian-based distro)
One example of a script to create a virtualenv Python environment is as follows:
#!/bin/sh
env/bin/pip install --download-cache=~/.pip-cache -r requirements.txt
Warning
The instructions here install certain packages, such as Django, South, Pillow and django CMS globally, which is not recommended. We recommend you use virtualenv instead (see above).
If you’re using Ubuntu (tested with 10.10), the following should get you started:
sudo aptitude install python2.6 python-setuptools
sudo easy_install pip
sudo pip install Django==1.5 django-cms south Pillow
Additionally, you need the Python driver for your selected database:
sudo aptitude python-psycopg2
or
sudo aptitude install python-mysql
This will install Django, django CMS, South, Pillow, and your database’s driver globally.
You have now everything that is needed for you to follow the Introductory Tutorial.
All you need to do is
$ sudo easy_install pip
If you’re using Homebrew you can install pip and virtualenv with the python generic package:
$ sudo brew install python
Then create an enviroment and work on it instead of install the packages in the system path:
$ virtualenv djangocms-env
$ ./djangocms-env/bin/activate
(djangocms-env)$ pip install Django==1.5 South Django-CMS
Note
You can see the general instructions on how to pip install packages after creating the virtualenv here: Installing in a virtualenv using pip
We recommend using PostgreSQL or MySQL with django CMS. Installing and maintaining database systems is outside the scope of this documentation, but is very well documented on the systems’ respective websites.
To use django CMS efficiently, we recommend: