Enable auto setup with cms_helper server command
This commit is contained in:
parent
ed37a44eee
commit
695c6a3ed9
1 changed files with 7 additions and 3 deletions
|
@ -3,7 +3,7 @@
|
||||||
from __future__ import absolute_import, print_function, unicode_literals
|
from __future__ import absolute_import, print_function, unicode_literals
|
||||||
|
|
||||||
import os
|
import os
|
||||||
|
import sys
|
||||||
from tempfile import mkdtemp
|
from tempfile import mkdtemp
|
||||||
|
|
||||||
|
|
||||||
|
@ -108,6 +108,7 @@ HELPER_SETTINGS = dict(
|
||||||
|
|
||||||
try:
|
try:
|
||||||
import cmsplugin_filer_image.migrations_django # pragma: no cover # NOQA
|
import cmsplugin_filer_image.migrations_django # pragma: no cover # NOQA
|
||||||
|
|
||||||
HELPER_SETTINGS[
|
HELPER_SETTINGS[
|
||||||
'MIGRATION_MODULES'
|
'MIGRATION_MODULES'
|
||||||
]['cmsplugin_filer_image'] = 'cmsplugin_filer_image.migrations_django'
|
]['cmsplugin_filer_image'] = 'cmsplugin_filer_image.migrations_django'
|
||||||
|
@ -117,9 +118,10 @@ except ImportError:
|
||||||
|
|
||||||
try:
|
try:
|
||||||
import knocker # pragma: no cover # NOQA
|
import knocker # pragma: no cover # NOQA
|
||||||
|
|
||||||
HELPER_SETTINGS['INSTALLED_APPS'].append('knocker')
|
HELPER_SETTINGS['INSTALLED_APPS'].append('knocker')
|
||||||
HELPER_SETTINGS['INSTALLED_APPS'].append('channels')
|
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'] = {
|
HELPER_SETTINGS['CHANNEL_LAYERS'] = {
|
||||||
'default': {
|
'default': {
|
||||||
'BACKEND': 'asgiref.inmemory.ChannelLayer',
|
'BACKEND': 'asgiref.inmemory.ChannelLayer',
|
||||||
|
@ -130,6 +132,9 @@ except ImportError:
|
||||||
pass
|
pass
|
||||||
os.environ['AUTH_USER_MODEL'] = 'tests.test_utils.CustomUser'
|
os.environ['AUTH_USER_MODEL'] = 'tests.test_utils.CustomUser'
|
||||||
|
|
||||||
|
if 'server' in sys.argv[:3]:
|
||||||
|
HELPER_SETTINGS['BLOG_AUTO_SETUP'] = True
|
||||||
|
|
||||||
|
|
||||||
def run():
|
def run():
|
||||||
from djangocms_helper import runner
|
from djangocms_helper import runner
|
||||||
|
@ -137,7 +142,6 @@ def run():
|
||||||
|
|
||||||
|
|
||||||
def setup():
|
def setup():
|
||||||
import sys
|
|
||||||
from djangocms_helper import runner
|
from djangocms_helper import runner
|
||||||
runner.setup('djangocms_blog', sys.modules[__name__], use_cms=True)
|
runner.setup('djangocms_blog', sys.modules[__name__], use_cms=True)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue