4

I got the same error 3 times already, before I didn't find the solution in Google nor here, and I guess I'm not the only one who got it.

From a fresh installation, I install at the same time the django-cms plugin an many of its plugins.

After running

python manage.py makemigrations
python manage.py migrate

I get this error: django.db.utils.ProgrammingError: relation "cms_cmsplugin" does not exist

5 Answers 5

3

Well, what I do is to remove all cms plugins except 'cms' itself, run python manage.py migrate add again all plugins and alter, again, python manage.py migrate

It seems that Django tries to create the tables for the plugins before the 'cms' app's one

As you see it's not a big deal if you just know it.

Usually people will install them one by one, but if you do it with pip from requirements.txt or similar, you will face this.

Sign up to request clarification or add additional context in comments.

1 Comment

this solution works, but becomes a big deal when you are doing automatic deploys. for example it's impossible to deploy on heroku in this way. ( or at least you have to do an ugly first commit with plugins commented, then ucommnet and commit just to do a second migrate )
2

Yeah I resolved this issue....the main thing was that i was using django 1.7 and by default it was trying to run south migrations so in order to resolve that i just added this to MIGRATION_MODULE under the settings.py: 'djangocms_text_ckeditor': 'djangocms_text_ckeditor.migrations_django',

This will explicitly tell the framework to run migrations instead of south migrations. Since the main issue was djangocms_text_ckeditor's table was not getting created under the db

2 Comments

just an update, the variable is called MIGRATION_MODULES (plural). currently (decembre 2015) the only plugin left to be listed seems to be 'cmsplugin_filer_image': 'cmsplugin_filer_image.migrations_django',
I still had to add all of them as described here: github.com/divio/cmsplugin-filer#installation even using Django 1.8.
0

I'm not familiar with the specific issue, but sometimes going to migrations folder in your app

(app->migrations) and deleting all the files except the __init__ files and running python manage.py migrate helped me.

2 Comments

Man, I'm not sure why they vote you down, I didn't try your solution but it should work if you do it first in the django_cms' folder.
This is a problem with the migrations of third party modules. How is deleting their migration files even an option?
0

I just comment all of my custom django cms plugins in my django settings and migrate. Then uncomment them and migrate again.

# setting.py
INSTALLED_APPS = (
    'django.contrib.auth',
    'django.contrib.contenttypes',
    'django.contrib.sessions',
    'django.contrib.admin',
    'django.contrib.sites',
    ...
    # 'MY_DJANGO_CMS_PLUGIN',
)

After that run

python manage.py migrate

And uncomment MY_DJANGO_CMS_PLUGIN, and run migrate again.

Comments

0

As this seems to be top answer when searching for django.db.utils.programmingerror: relation "x" does not exist..

We encountered this issue in our DevOps pipeline, and were able to resolve it by listing the migrations with python manage.py showmigrations immediately before the problem task.

Possible it's refreshing on re-examining the database..

https://docs.djangoproject.com/en/4.1/ref/django-admin/#django-admin-showmigrations

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.