Installation
We will soon update this page. To find the latest Updates and information about django-cms V2 visit us on github.
Note: If you are using latest SVN version, you should read the Getting Started guide in the trac wiki which is more up-to-date.
We assume that you already have a running Django installation with a database and that you downloaded django-cms and stored it in your Django project directory.
1. Copy django-cms settings into your project directory.
cd ~/your_project_directory cp cms/cms_settings.py.dist cms_settings.py
2. Edit the django-cms configuration file. You can find additional django-cms configuration options in cms/cms_global_settings.py. An example default template (for the DEFAULT_TEMPLATE setting) is cms/base.html.
3. If you don't have django.template.loaders.app_directories.load_template_source in your TEMPLATE_LOADERS setting, you need to set up the django-cms template directory by adding it to your TEMPLATE_DIRS in settings.py:
TEMPLATE_DIRS = (
'/path-to-your-project/cms/templates',
)
4. Set up media directories:
django-cms media files are needed for the admin interface. They are served under the ADMIN_MEDIA_PREFIX+'cms/' URL. For example, if your ADMIN_MEDIA_PREFIX is set to "/media/admin/", django-cms expects the media files in http://yoursite/media/admin/cms/.
One way to set up media files is creating a symlink in your existing media directory. For example:
cd media/admin ln -s ../../cms/media cms
Another way is directly configuring your webserver to serve the Django media files at the specified URL.
5. Add django-cms to the list of installed applications:
INSTALLED_APPS = (
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.sites',
'django.contrib.admin',
'cms',
)
Please note that you need all of the applications listed above.
6. Make sure LocaleMiddleware is in your MIDDLEWARE_CLASSES. You may also want to enable the XHTMLToHTMLMiddleware if you plan to use HTML4 (which we recommend).
MIDDLEWARE_CLASSES = (
'django.middleware.common.CommonMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.locale.LocaleMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.middleware.doc.XViewMiddleware',
)
7. Finally, configure your urls.py:
from django.conf.urls.defaults import *
from django.contrib import admin
admin.autodiscover()
urlpatterns = patterns('',
(r'^admin/', include('cms.admin_urls')),
(r'^admin/(.*)', admin.site.root),
(r'^((.*)/)?$', include('cms.urls')),
)
Place any other URLs at the top.
The last line configures django-cms at the page root /
8. Now you can go ahead and create the database tables.
$ python manage.py syncdb Creating table cms_page Creating table cms_pagecontent Installing index for cms.Page model Installing index for cms.PageContent model
9. Finally, go to the admin site and create a new page.



