From 695c6a3ed9b353e28023fa264e15f855f5bfd065 Mon Sep 17 00:00:00 2001 From: Iacopo Spalletti Date: Sat, 4 Mar 2017 16:21:52 +0100 Subject: [PATCH] Enable auto setup with cms_helper server command --- cms_helper.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/cms_helper.py b/cms_helper.py index 688c8f8..8f28c53 100755 --- a/cms_helper.py +++ b/cms_helper.py @@ -3,7 +3,7 @@ from __future__ import absolute_import, print_function, unicode_literals import os - +import sys from tempfile import mkdtemp @@ -108,6 +108,7 @@ HELPER_SETTINGS = dict( try: import cmsplugin_filer_image.migrations_django # pragma: no cover # NOQA + HELPER_SETTINGS[ 'MIGRATION_MODULES' ]['cmsplugin_filer_image'] = 'cmsplugin_filer_image.migrations_django' @@ -117,9 +118,10 @@ except ImportError: try: import knocker # pragma: no cover # NOQA + HELPER_SETTINGS['INSTALLED_APPS'].append('knocker') HELPER_SETTINGS['INSTALLED_APPS'].append('channels') - HELPER_SETTINGS['INSTALLED_APPS'].append('djangocms_blog.liveblog',) + HELPER_SETTINGS['INSTALLED_APPS'].append('djangocms_blog.liveblog', ) HELPER_SETTINGS['CHANNEL_LAYERS'] = { 'default': { 'BACKEND': 'asgiref.inmemory.ChannelLayer', @@ -130,6 +132,9 @@ except ImportError: pass os.environ['AUTH_USER_MODEL'] = 'tests.test_utils.CustomUser' +if 'server' in sys.argv[:3]: + HELPER_SETTINGS['BLOG_AUTO_SETUP'] = True + def run(): from djangocms_helper import runner @@ -137,7 +142,6 @@ def run(): def setup(): - import sys from djangocms_helper import runner runner.setup('djangocms_blog', sys.modules[__name__], use_cms=True)