Installation: django.db.utils.ProgrammingError: relation "djangocms_blog_blogconfig" does not exist
See original GitHub issueHi,
I’m trying to install djangocms_blog after successfully installing django-cms.
I’ve followed the installation guide up to the point of migration. But either syncdb or migrate give me this error:
Traceback
Traceback (most recent call last):
File "./manage.py", line 10, in <module>
execute_from_command_line(sys.argv)
File "/home/nikhil/.virtualenvs/dsff/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 354, in execute_from_command_line
utility.execute()
File "/home/nikhil/.virtualenvs/dsff/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 328, in execute
django.setup()
File "/home/nikhil/.virtualenvs/dsff/local/lib/python2.7/site-packages/django/__init__.py", line 18, in setup
apps.populate(settings.INSTALLED_APPS)
File "/home/nikhil/.virtualenvs/dsff/local/lib/python2.7/site-packages/django/apps/registry.py", line 115, in populate
app_config.ready()
File "/home/nikhil/.virtualenvs/dsff/local/lib/python2.7/site-packages/debug_toolbar/apps.py", line 15, in ready
patch_root_urlconf()
File "/home/nikhil/.virtualenvs/dsff/local/lib/python2.7/site-packages/debug_toolbar/settings.py", line 220, in patch_root_urlconf
reverse('djdt:render_panel')
File "/home/nikhil/.virtualenvs/dsff/local/lib/python2.7/site-packages/django/core/urlresolvers.py", line 549, in reverse
app_list = resolver.app_dict[ns]
File "/home/nikhil/.virtualenvs/dsff/local/lib/python2.7/site-packages/django/core/urlresolvers.py", line 351, in app_dict
self._populate()
File "/home/nikhil/.virtualenvs/dsff/local/lib/python2.7/site-packages/django/core/urlresolvers.py", line 284, in _populate
for pattern in reversed(self.url_patterns):
File "/home/nikhil/.virtualenvs/dsff/local/lib/python2.7/site-packages/django/core/urlresolvers.py", line 401, in url_patterns
patterns = getattr(self.urlconf_module, "urlpatterns", self.urlconf_module)
File "/home/nikhil/.virtualenvs/dsff/local/lib/python2.7/site-packages/django/core/urlresolvers.py", line 395, in urlconf_module
self._urlconf_module = import_module(self.urlconf_name)
File "/usr/lib/python2.7/importlib/__init__.py", line 37, in import_module
__import__(name)
File "/home/nikhil/dev/dsff/config/urls.py", line 85, in <module>
url(r'^dsffadmin/', include(admin.site.urls)),
File "/home/nikhil/.virtualenvs/dsff/local/lib/python2.7/site-packages/django/contrib/admin/sites.py", line 291, in urls
return self.get_urls(), 'admin', self.name
File "/home/nikhil/.virtualenvs/dsff/local/lib/python2.7/site-packages/django/contrib/admin/sites.py", line 275, in get_urls
url(r'^%s/%s/' % (model._meta.app_label, model._meta.model_name), include(model_admin.urls)),
File "/home/nikhil/.virtualenvs/dsff/local/lib/python2.7/site-packages/django/contrib/admin/options.py", line 633, in urls
return self.get_urls()
File "/home/nikhil/.virtualenvs/dsff/local/lib/python2.7/site-packages/cms/admin/placeholderadmin.py", line 138, in get_urls
from cms.urls import SLUG_REGEXP
File "/home/nikhil/.virtualenvs/dsff/local/lib/python2.7/site-packages/cms/urls.py", line 17, in <module>
if apphook_pool.get_apphooks():
File "/home/nikhil/.virtualenvs/dsff/local/lib/python2.7/site-packages/cms/apphook_pool.py", line 70, in get_apphooks
self.discover_apps()
File "/home/nikhil/.virtualenvs/dsff/local/lib/python2.7/site-packages/cms/apphook_pool.py", line 62, in discover_apps
load('cms_app')
File "/home/nikhil/.virtualenvs/dsff/local/lib/python2.7/site-packages/cms/utils/django_load.py", line 61, in load
get_module(app, modname, verbose, failfast)
File "/home/nikhil/.virtualenvs/dsff/local/lib/python2.7/site-packages/cms/utils/django_load.py", line 45, in get_module
module = import_module(module_name)
File "/usr/lib/python2.7/importlib/__init__.py", line 37, in import_module
__import__(name)
File "/home/nikhil/.virtualenvs/dsff/local/lib/python2.7/site-packages/djangocms_blog/cms_app.py", line 32, in <module>
BlogApp.setup()
File "/home/nikhil/.virtualenvs/dsff/local/lib/python2.7/site-packages/djangocms_apphook_setup/base.py", line 150, in setup
if not configs.exists():
File "/home/nikhil/.virtualenvs/dsff/local/lib/python2.7/site-packages/django/db/models/query.py", line 586, in exists
return self.query.has_results(using=self.db)
File "/home/nikhil/.virtualenvs/dsff/local/lib/python2.7/site-packages/django/db/models/sql/query.py", line 484, in has_results
return compiler.has_results()
File "/home/nikhil/.virtualenvs/dsff/local/lib/python2.7/site-packages/django/db/models/sql/compiler.py", line 811, in has_results
return bool(self.execute_sql(SINGLE))
File "/home/nikhil/.virtualenvs/dsff/local/lib/python2.7/site-packages/django/db/models/sql/compiler.py", line 840, in execute_sql
cursor.execute(sql, params)
File "/home/nikhil/.virtualenvs/dsff/local/lib/python2.7/site-packages/django/db/backends/utils.py", line 79, in execute
return super(CursorDebugWrapper, self).execute(sql, params)
File "/home/nikhil/.virtualenvs/dsff/local/lib/python2.7/site-packages/django/db/backends/utils.py", line 64, in execute
return self.cursor.execute(sql, params)
File "/home/nikhil/.virtualenvs/dsff/local/lib/python2.7/site-packages/django/db/utils.py", line 98, in __exit__
six.reraise(dj_exc_type, dj_exc_value, traceback)
File "/home/nikhil/.virtualenvs/dsff/local/lib/python2.7/site-packages/django/db/backends/utils.py", line 64, in execute
return self.cursor.execute(sql, params)
django.db.utils.ProgrammingError: relation "djangocms_blog_blogconfig" does not exist
LINE 1: SELECT (1) AS "a" FROM "djangocms_blog_blogconfig" LIMIT 1
Settings
# -*- coding: utf-8 -*-
"""
Django settings for dsff project.
For more information on this file, see
https://docs.djangoproject.com/en/dev/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/dev/ref/settings/
"""
from __future__ import absolute_import, unicode_literals
import environ
ROOT_DIR = environ.Path(__file__) - 3 # (/a/b/myfile.py - 3 = /)
APPS_DIR = ROOT_DIR.path('dsff')
env = environ.Env()
# APP CONFIGURATION
# ------------------------------------------------------------------------------
DJANGO_APPS = (
# Default Django apps:
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.sites',
'django.contrib.messages',
'django.contrib.staticfiles',
# Useful template tags:
# 'django.contrib.humanize',
'dsff.users', # custom users app
'reversion',
'suit',
'cms',
'treebeard', # utilities for implementing a tree
'mptt', # utilities for implementing a tree
'menus', # helper for model independent hierarchical website navigation
'sekizai', # for javascript and css management
'filer',
'easy_thumbnails',
'parler',
'cmsplugin_filer_file',
'cmsplugin_filer_folder',
'cmsplugin_filer_link',
'cmsplugin_filer_image',
'cmsplugin_filer_teaser',
'cmsplugin_filer_video',
'djangocms_googlemap',
'djangocms_inherit',
'djangocms_snippet',
# Admin
'djangocms_admin_style', # for the admin skin. You **must** add 'djangocms_admin_style' in the list **before** 'django.contrib.admin'.
'django.contrib.admin',
)
THIRD_PARTY_APPS = (
'crispy_forms', # Form layouts
'djcelery',
'allauth',
'allauth.account',
'allauth.socialaccount',
'allauth.socialaccount.providers.facebook',
'meta',
'meta_mixin',
'taggit',
'taggit_autosuggest',
'admin_enhancer',
'djangocms_blog',
'django_fsm',
'post_office',
)
# Apps specific for this project go here.
LOCAL_APPS = (
'dsff.general',
'dsff.tickets',
'dsff.entertainment',
'dsff.events',
'dsff.payment',
# Your stuff: custom apps go here
)
# See: https://docs.djangoproject.com/en/dev/ref/settings/#installed-apps
INSTALLED_APPS = DJANGO_APPS + THIRD_PARTY_APPS + LOCAL_APPS
# MIDDLEWARE CONFIGURATION
# ------------------------------------------------------------------------------
MIDDLEWARE_CLASSES = (
# Make sure djangosecure.middleware.SecurityMiddleware is listed first
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.common.CommonMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.clickjacking.XFrameOptionsMiddleware',
'cms.middleware.user.CurrentUserMiddleware',
'cms.middleware.page.CurrentPageMiddleware',
'cms.middleware.toolbar.ToolbarMiddleware',
'cms.middleware.language.LanguageCookieMiddleware',
)
# MIGRATIONS CONFIGURATION
# ------------------------------------------------------------------------------
MIGRATION_MODULES = {
'sites': 'dsff.contrib.sites.migrations',
'djangocms_googlemap': 'djangocms_googlemap.migrations_django',
'djangocms_snippet': 'djangocms_snippet.migrations_django',
'djangocms_inherit': 'djangocms_inherit.migrations_django',
'cmsplugin_filer_file': 'cmsplugin_filer_file.migrations_django',
'cmsplugin_filer_folder': 'cmsplugin_filer_folder.migrations_django',
'cmsplugin_filer_link': 'cmsplugin_filer_link.migrations_django',
'cmsplugin_filer_image': 'cmsplugin_filer_image.migrations_django',
'cmsplugin_filer_teaser': 'cmsplugin_filer_teaser.migrations_django',
'cmsplugin_filer_video': 'cmsplugin_filer_video.migrations_django',
}
# DEBUG
# ------------------------------------------------------------------------------
# See: https://docs.djangoproject.com/en/dev/ref/settings/#debug
DEBUG = env.bool("DJANGO_DEBUG", False)
# FIXTURE CONFIGURATION
# ------------------------------------------------------------------------------
# See: https://docs.djangoproject.com/en/dev/ref/settings/#std:setting-FIXTURE_DIRS
FIXTURE_DIRS = (
str(APPS_DIR.path('fixtures')),
)
# EMAIL CONFIGURATION
# ------------------------------------------------------------------------------
EMAIL_BACKEND = env('DJANGO_EMAIL_BACKEND', default='django.core.mail.backends.smtp.EmailBackend')
# MANAGER CONFIGURATION
# ------------------------------------------------------------------------------
# See: https://docs.djangoproject.com/en/dev/ref/settings/#admins
ADMINS = (
("""xxxxxxxx""", 'xxxxxxxxx'),
)
# See: https://docs.djangoproject.com/en/dev/ref/settings/#managers
MANAGERS = ADMINS
EVENT_ADMINS = (
("""xxxxxx""", 'xxxxxxxxxxx'),
("""xxxxxx"", 'xxxxxx'),
("""xxxxxxxx"", 'xxxxxxxxxxxxxx'),
)
# DATABASE CONFIGURATION
# ------------------------------------------------------------------------------
# See: https://docs.djangoproject.com/en/dev/ref/settings/#databases
DATABASES = {
# Raises ImproperlyConfigured exception if DATABASE_URL not in os.environ
'default': env.db("DJANGO_DB_URL", default="postgres//postgres:123456@localhost/dsff"),
}
DATABASES['default']['ATOMIC_REQUESTS'] = True
# GENERAL CONFIGURATION
# ------------------------------------------------------------------------------
# Local time zone for this installation. Choices can be found here:
# http://en.wikipedia.org/wiki/List_of_tz_zones_by_name
# although not all choices may be available on all operating systems.
# In a Windows environment this must be set to your system time zone.
TIME_ZONE = 'Africa/Johannesburg'
# See: https://docs.djangoproject.com/en/dev/ref/settings/#language-code
LANGUAGE_CODE = 'en'
LANGUAGES = (
('en', 'English'),
)
# See: https://docs.djangoproject.com/en/dev/ref/settings/#site-id
SITE_ID = 1
# See: https://docs.djangoproject.com/en/dev/ref/settings/#use-i18n
USE_I18N = True
# See: https://docs.djangoproject.com/en/dev/ref/settings/#use-l10n
USE_L10N = True
# See: https://docs.djangoproject.com/en/dev/ref/settings/#use-tz
USE_TZ = True
# TEMPLATE CONFIGURATION
# ------------------------------------------------------------------------------
# See: https://docs.djangoproject.com/en/dev/ref/settings/#templates
TEMPLATES = [
{
# See: https://docs.djangoproject.com/en/dev/ref/settings/#std:setting-TEMPLATES-BACKEND
'BACKEND': 'django.template.backends.django.DjangoTemplates',
# See: https://docs.djangoproject.com/en/dev/ref/settings/#template-dirs
'DIRS': [
str(APPS_DIR.path('templates')),
],
'OPTIONS': {
# See: https://docs.djangoproject.com/en/dev/ref/settings/#template-debug
'debug': DEBUG,
# See: https://docs.djangoproject.com/en/dev/ref/settings/#template-loaders
# https://docs.djangoproject.com/en/dev/ref/templates/api/#loader-types
'loaders': [
'django.template.loaders.filesystem.Loader',
'django.template.loaders.app_directories.Loader',
],
# See: https://docs.djangoproject.com/en/dev/ref/settings/#template-context-processors
'context_processors': [
'django.template.context_processors.debug',
'django.template.context_processors.request',
'django.contrib.auth.context_processors.auth',
'django.template.context_processors.i18n',
'django.template.context_processors.media',
'django.template.context_processors.static',
'django.template.context_processors.tz',
'django.contrib.messages.context_processors.messages',
'sekizai.context_processors.sekizai',
'cms.context_processors.cms_settings',
# Your stuff: custom template context processors go here
],
},
},
]
########## CELERY
INSTALLED_APPS += ('dsff.taskapp.celery.CeleryConfig',)
# if you are not using the django database broker (e.g. rabbitmq, redis, memcached), you can remove the next line.
INSTALLED_APPS += ('kombu.transport.redis',)
BROKER_URL = env("CELERY_BROKER_URL", default='redis://')
########## END CELERY
# See: http://django-crispy-forms.readthedocs.org/en/latest/install.html#template-packs
CRISPY_TEMPLATE_PACK = 'bootstrap3'
# STATIC FILE CONFIGURATION
# ------------------------------------------------------------------------------
# See: https://docs.djangoproject.com/en/dev/ref/settings/#static-root
STATIC_ROOT = str(ROOT_DIR('staticfiles'))
# See: https://docs.djangoproject.com/en/dev/ref/settings/#static-url
STATIC_URL = '/static/'
# See: https://docs.djangoproject.com/en/dev/ref/contrib/staticfiles/#std:setting-STATICFILES_DIRS
STATICFILES_DIRS = (
str(APPS_DIR.path('static')),
)
# See: https://docs.djangoproject.com/en/dev/ref/contrib/staticfiles/#staticfiles-finders
STATICFILES_FINDERS = (
'django.contrib.staticfiles.finders.FileSystemFinder',
'django.contrib.staticfiles.finders.AppDirectoriesFinder',
)
# MEDIA CONFIGURATION
# ------------------------------------------------------------------------------
# See: https://docs.djangoproject.com/en/dev/ref/settings/#media-root
MEDIA_ROOT = str(APPS_DIR('media'))
# See: https://docs.djangoproject.com/en/dev/ref/settings/#media-url
MEDIA_URL = '/media/'
# URL Configuration
# ------------------------------------------------------------------------------
ROOT_URLCONF = 'config.urls'
# See: https://docs.djangoproject.com/en/dev/ref/settings/#wsgi-application
WSGI_APPLICATION = 'config.wsgi.application'
# AUTHENTICATION CONFIGURATION
# ------------------------------------------------------------------------------
AUTHENTICATION_BACKENDS = (
'django.contrib.auth.backends.ModelBackend',
'allauth.account.auth_backends.AuthenticationBackend',
)
# Some really nice defaults
ACCOUNT_AUTHENTICATION_METHOD = 'username_email'
ACCOUNT_EMAIL_REQUIRED = True
ACCOUNT_EMAIL_VERIFICATION = 'mandatory'
# Custom user app defaults
# Select the correct user model
AUTH_USER_MODEL = 'users.User'
LOGIN_REDIRECT_URL = 'events:list'
LOGIN_URL = 'account_login'
# SLUGLIFIER
AUTOSLUG_SLUGIFY_FUNCTION = 'slugify.slugify'
# LOGGING CONFIGURATION
# ------------------------------------------------------------------------------
# See: https://docs.djangoproject.com/en/dev/ref/settings/#logging
# A sample logging configuration. The only tangible logging
# performed by this configuration is to send an email to
# the site admins on every HTTP 500 error when DEBUG=False.
# See http://docs.djangoproject.com/en/dev/topics/logging for
# more details on how to customize your logging configuration.
LOGGING = {
'version': 1,
'disable_existing_loggers': False,
'filters': {
'require_debug_false': {
'()': 'django.utils.log.RequireDebugFalse'
}
},
'handlers': {
'mail_admins': {
'level': 'ERROR',
'filters': ['require_debug_false'],
'class': 'django.utils.log.AdminEmailHandler'
}
},
'loggers': {
'django.request': {
'handlers': ['mail_admins'],
'level': 'ERROR',
'propagate': True,
},
}
}
# DJANGO CMS
# --------------------------------------------------------------------------------
CMS_TEMPLATES = (
('cms/pages/blog_list.html', 'Blog List'),
('cms/pages/blog_detail.html', 'Blog Detail'),
)
THUMBNAIL_PROCESSORS = (
'easy_thumbnails.processors.colorspace',
'easy_thumbnails.processors.autocrop',
'filer.thumbnail_processors.scale_and_crop_with_subject_location',
'easy_thumbnails.processors.filters',
)
PARLER_LANGUAGES = {
1: (
{'code': 'en', },
),
}
META_SITE_PROTOCOL = 'http'
META_USE_SITES = True
TEXT_SAVE_IMAGE_FUNCTION='cmsplugin_filer_image.integrations.ckeditor.create_image_plugin'
CMSPLUGIN_FILER_IMAGE_STYLE_CHOICES = (
('default', 'Default'),
('boxed', 'Boxed'),
)
CMSPLUGIN_FILER_IMAGE_DEFAULT_STYLE = 'boxed'
# Your common stuff: Below this line define 3rd party library settings
DATE_FORMAT = '%Y-%m-%d %H:%M:%S'
Packages
Babel==2.1.1
Django==1.8.6
Django-Select2==4.3.2
Jinja2==2.8
MarkupSafe==0.23
Pillow==2.9.0
Pygments==2.0.2
Sphinx==1.3.1
URLObject==2.4.0
Unidecode==0.04.18
Werkzeug==0.10.4
YURL==0.13
alabaster==0.7.6
aldryn-apphooks-config==0.2.6
aldryn-boilerplates==0.7.3
aldryn-common==1.0.0
aldryn-search==0.2.10
amqp==1.4.7
anyjson==0.3.3
argparse==1.2.1
billiard==3.3.0.21
celery==3.1.19
cmsplugin-filer==1.0.0
coverage==3.7.1
cssselect==0.9.1
django-activity-stream==0.6.0
django-admin-enhancer==1.0.0
django-allauth==0.23.0
django-appconf==1.0.1
django-appdata==0.1.4
django-autoslug==1.8.0
django-braces==1.8.1
django-celery==3.1.17
django-classy-tags==0.6.2
django-cms==3.1.3
django-crispy-forms==1.4.0
django-debug-toolbar==1.3.0
django-environ==0.3.0
django-extensions==1.5.9
django-filer==1.0.2
django-floppyforms==1.5.2
django-fsm==2.3.0
django-haystack==2.4.1
django-meta==0.3.1
django-meta-mixin==0.2.1
django-model-utils==2.3.1
django-mptt==0.7.4
django-parler==1.5.1
django-phonenumber-field==0.7.2
django-polymorphic==0.7.2
django-post-office==2.0.3
django-redis==4.2.0
django-reversion==1.9.3
django-secure==1.0.1
django-sekizai==0.8.2
django-sortedm2m==1.0.2
django-spurl==0.6.2
django-standard-form==1.1.1
django-suit==0.2.15
django-taggit==0.17.0
django-taggit-autosuggest==0.2.7
django-taggit-templatetags==0.2.5
django-templatetag-sugar==1.0
django-treebeard==3.0
djangocms-admin-style==1.0.5
djangocms-apphook-setup==0.1.1
djangocms-blog==0.6.2
djangocms-column==1.5
djangocms-file==0.1
djangocms-flash==0.2.0
djangocms-googlemap==0.3
djangocms-grid==1.2
djangocms-inherit==0.1
djangocms-link==1.7.1
djangocms-oembed==0.5
djangocms-picture==0.1
djangocms-snippet==1.5
djangocms-style==1.5
djangocms-table==1.2
djangocms-teaser==0.1
djangocms-text-ckeditor==2.7.0
djangocms-video==0.1
docutils==0.12
easy-thumbnails==2.2.1
graphviz==0.4.7
html2text==2015.6.21
html5lib==0.9999999
jsonfield==1.0.3
kombu==3.0.29
lxml==3.5.0
micawber==0.3.3
msgpack-python==0.4.6
numpy==1.10.1
oauthlib==1.0.3
pandas==0.17.0
phonenumbers==7.1.1
-e git+https://github.com/sendwithus/premailer.git@25a9687d2808d3498a63644a3915daddf2474994#egg=premailer-master
psycopg2==2.6.1
pyquery==1.2.9
python-dateutil==2.4.2
python-openid==2.2.5
pytz==2015.4
redis==2.10.5
requests==2.8.1
requests-oauthlib==0.5.0
shortuuid==0.4.2
six==1.10.0
snowballstemmer==1.2.0
sphinx-rtd-theme==0.1.9
sqlparse==0.1.18
unicode-slugify==0.1.3
whitenoise==2.0.2
wsgiref==0.1.2
Any guidance would be appreciated.
Issue Analytics
- State:
- Created 8 years ago
- Comments:14 (7 by maintainers)
Top Results From Across the Web
No results found
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I’ve fallen onto this issue with a fresh installation. i am using django-cms v4 which could introduce it’s own set of issues. The issue appears to be because the cms’s app registration tries to load modules in, including the wizards. It falls over because the following logic tries to run imediatley when the codeis loaded, prompting a call to a model that doesn’t yet have migrations. You can’t created migrations because any manage.py command fails for the same reason.
Commenting out the following code allowed me to continue, I then uncommented once I had ran
python manage.py migrate
https://github.com/nephila/djangocms-blog/blob/d18382808766548c0ec1b9f0dabe443d5430aebf/djangocms_blog/cms_wizards.py#L100Closing this Feel free to reopen if you encounter more issues