War Gravy
War Gravy

Reputation: 1683

How to add an app to Django CMS 3.0.12 and migrate?

I am new to Django and DjangoCMS. I recently installed DjangoCMS and am looking to write my own app for it by following the tutorials Tutorial 1 and Introduction to Plugins.

After some researching and testing, I have discovered that when I try to run either of the commands:

python manage.py migrate

or

python manage.py makemigrations polls

I end up running into the following error:

Traceback (most recent call last):
  File "manage.py", line 10, in <module>
    execute_from_command_line(sys.argv)
  File "/home/username/folder/DjangoCMS/env/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 338, in execute_from_command_line
    utility.execute()
  File "/home/username/folder/DjangoCMS/env/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 312, in execute
    django.setup()
  File "/home/username/folder/DjangoCMS/env/local/lib/python2.7/site-packages/django/__init__.py", line 18, in setup
    apps.populate(settings.INSTALLED_APPS)
  File "/home/username/folder/DjangoCMS/env/local/lib/python2.7/site-packages/django/apps/registry.py", line 108, in populate
   app_config.import_models(all_models)
  File "/home/username/folder/DjangoCMS/env/local/lib/python2.7/site-packages/django/apps/config.py", line 198, in import_models
   self.models_module = import_module(models_module_name)
  File "/usr/lib/python2.7/importlib/__init__.py", line 37, in import_module
    __import__(name)
  File "/home/username/folder/DjangoCMS/env/local/lib/python2.7/site-packages/djangocms_text_ckeditor/models.py", line 14, in <module>
    from cms.models import CMSPlugin
  File "/home/username/folder/DjangoCMS/env/local/lib/python2.7/site-packages/cms/models/__init__.py", line 3, in <module>
    from .pagemodel import *  # nopyflakes
  File "/home/username/folder/DjangoCMS/env/local/lib/python2.7/site-packages/cms/models/pagemodel.py", line 20, in <module>
    from cms.models.placeholdermodel import Placeholder
  File "/home/username/folder/DjangoCMS/env/local/lib/python2.7/site-packages/cms/models/placeholdermodel.py", line 16, in <module>
    from cms.utils.placeholder import PlaceholderNoAction, get_placeholder_conf
  File "/home/username/folder/DjangoCMS/env/local/lib/python2.7/site-packages/cms/utils/placeholder.py", line 8, in <module>
    from sekizai.helpers import get_varname
  File "/home/username/folder/DjangoCMS/env/local/lib/python2.7/site-packages/sekizai/helpers.py", line 3, in <module>
    from django.template import VariableNode, Variable
ImportError: cannot import name VariableNode

I think it is specific to the installed apps I have set in my settings.py file because as I have been working on this error, I have discovered that most of the apps that come set in INSTALLED_APPS for DjangoCMS actually don't have to be installed for me to run the website locally.

INSTALLED_APPS = (
    'djangocms_admin_style',
    'djangocms_text_ckeditor',
    'django.contrib.auth',
    'django.contrib.contenttypes',
    'django.contrib.sessions',
    'django.contrib.admin',
    'django.contrib.sites',
    'django.contrib.sitemaps',
    'django.contrib.staticfiles',
    'django.contrib.messages',
    'djangocms_style',
    'djangocms_column',
    'djangocms_file',
    'djangocms_flash',
    'djangocms_googlemap',
    'djangocms_inherit',
    'djangocms_link',
    'djangocms_picture',
    'djangocms_teaser',
    'djangocms_video',
    'cms',
    'menus',
    'sekizai',
    'reversion',
    'mptt',
    'south',
    'mywebsite',
    'polls'
)

Looking at the stack I think this particular error is related to the sekizai app but when I go ahead and pip install django-sekizai I still get the same error when I try to migrate.

Upvotes: 1

Views: 1713

Answers (2)

RVE
RVE

Reputation: 348

I tried this with Django==1.9.7, if you upgrade django-sekizai to version 0.9.0, then the error dissapears. So just upgrade you'r django-sekizai to the latest version for you'r Django-version.

pip install django-sekizai==0.9.0

Upvotes: 2

War Gravy
War Gravy

Reputation: 1683

So I have discovered the problem. DjangoCMS only works properly when using Django version 1.6 and is dependent on the south migrations package/app.

In order to fix the problem just do the following:

pip install django==1.6

Also make sure to be using the right tutorials, and you can check this by looking at the URL.

Something I have noticed so far, makemigrations does not exist in django 1.6 :(

Upvotes: 1

Related Questions