mirror of
https://github.com/django/daphne.git
synced 2025-04-20 08:42:18 +03:00
Fail to work if you have channel-enabled Django
This commit is contained in:
parent
d29f02fb33
commit
4bab456c61
|
@ -1,4 +1,5 @@
|
|||
from django.apps import AppConfig
|
||||
from django.core.exceptions import ImproperlyConfigured
|
||||
|
||||
|
||||
class ChannelsConfig(AppConfig):
|
||||
|
@ -7,6 +8,13 @@ class ChannelsConfig(AppConfig):
|
|||
verbose_name = "Channels"
|
||||
|
||||
def ready(self):
|
||||
# Check you're not running 1.10 or above
|
||||
try:
|
||||
from django import channels
|
||||
except ImportError:
|
||||
pass
|
||||
else:
|
||||
raise ImproperlyConfigured("You have Django 1.10 or above; use the builtin django.channels!")
|
||||
# Do django monkeypatches
|
||||
from .hacks import monkeypatch_django
|
||||
monkeypatch_django()
|
||||
|
|
Loading…
Reference in New Issue
Block a user