mirror of
https://github.com/django/daphne.git
synced 2025-07-06 12:53:05 +03:00
Remove conditional import in apps.py
There's no point importing apps.py if Django is not installed.
This commit is contained in:
parent
d0f281f133
commit
aaefa46cd7
|
@ -2,19 +2,14 @@
|
||||||
# packages import twisted.internet.reactor (e.g. raven does this).
|
# packages import twisted.internet.reactor (e.g. raven does this).
|
||||||
import daphne.server # noqa: F401
|
import daphne.server # noqa: F401
|
||||||
|
|
||||||
try:
|
from django.apps import AppConfig
|
||||||
# Allow that Django is not installed.
|
from django.core import checks
|
||||||
from django.apps import AppConfig
|
|
||||||
from django.core import checks
|
|
||||||
|
|
||||||
from .checks import check_daphne_installed
|
from .checks import check_daphne_installed
|
||||||
except ImportError:
|
|
||||||
pass
|
|
||||||
else:
|
|
||||||
|
|
||||||
class DaphneConfig(AppConfig):
|
class DaphneConfig(AppConfig):
|
||||||
name = "daphne"
|
name = "daphne"
|
||||||
verbose_name = "Daphne"
|
verbose_name = "Daphne"
|
||||||
|
|
||||||
def ready(self):
|
def ready(self):
|
||||||
checks.register(check_daphne_installed, checks.Tags.staticfiles)
|
checks.register(check_daphne_installed, checks.Tags.staticfiles)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user