Skip to content

Commit

Permalink
Fixed compatibility with newer channels releases
Browse files Browse the repository at this point in the history
  • Loading branch information
yakky committed Mar 4, 2017
1 parent 83dfe23 commit f3df207
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 6 deletions.
5 changes: 5 additions & 0 deletions HISTORY.rst
Expand Up @@ -3,6 +3,11 @@
History
-------

0.9.8 (2017-03-04)
++++++++++++++++++

* Fixed compatibility with newer channels releases

0.9.7 (2016-12-03)
++++++++++++++++++

Expand Down
16 changes: 10 additions & 6 deletions djangocms_helper/main.py
Expand Up @@ -237,7 +237,13 @@ def static_analisys(application):


def server(bind='127.0.0.1', port=8000, migrate_cmd=False, verbose=1): # pragma: no cover
from django.contrib.staticfiles.management.commands import runserver
try:
from channels.log import setup_logger
from channels.management.commands import runserver
logger = setup_logger('django.channels', 1)
except ImportError:
from django.contrib.staticfiles.management.commands import runserver
logger = None

if os.environ.get('RUN_MAIN') != 'true':
_create_db(migrate_cmd)
Expand All @@ -261,11 +267,9 @@ def server(bind='127.0.0.1', port=8000, migrate_cmd=False, verbose=1): # pragma
rs._raw_ipv6 = False
rs.addr = bind
rs.port = port
try:
from channels.log import setup_logger
rs.logger = setup_logger('django.channels', 1)
except ImportError:
pass
if logger:
rs.http_timeout = 60
rs.logger = logger
autoreload.main(rs.inner_run, (), {
'addrport': '%s:%s' % (bind, port),
'insecure_serving': True,
Expand Down

0 comments on commit f3df207

Please sign in to comment.