Question

I'm very new to django and in turn the django-cms app.

I have followed the tutorial step by step: (from the offical website ) on a new machine and have everything exactly as the tutorial does yet I still can't get anywhere.

I get to the final step in the setup process and everything falls over, When I run:

python manage.py syncdb --all

I get the following error:

CommandError: One or more models did not validate:
cms.page: 'site' has a relation with model <class 'django.contrib.sites.models.Site'>,     which has either not been installed or is abstract.
cms.globalpagepermission: 'sites' has an m2m relation with model <class 'django.contrib.sites.models.Site'>, which has either not been installed or is abstract.

To clarify this is happening at step 1.3.2.1. Fresh install in the tutorial

1.3.2.1. Fresh install

Run:

python manage.py syncdb --all
python manage.py migrate --fake

None of these commands work, both result in the above error.

I am not sure how to solve this or even find resource as to what is causing my problem, I have spent a short amount of time on both google and stackoverflow looking for answers with no result, I haven't been able to pin point the problem which is probably making things harder for me.

Any help is much appreciated.

My code is exactly the same as the tutorials which is why I haven't posted any.

Was it helpful?

Solution

I'm guessing that you are using the new Django 1.6. There the sites application is no longer included by default in your project. And as it seems the django-cms depends on it.

You can add it easily to the list of enabled applications in your settings.py file, in the INSTALLED_APPS list:

INSTALLED_APPS = (
    'django.contrib.auth',
    'django.contrib.contenttypes',
    'django.contrib.sessions',
    'django.contrib.sites',    # <----- here!
    ...
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top