mirror of
https://github.com/django/daphne.git
synced 2025-04-20 00:32:09 +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).
|
||||
import daphne.server # noqa: F401
|
||||
|
||||
try:
|
||||
# Allow that Django is not installed.
|
||||
from django.apps import AppConfig
|
||||
from django.core import checks
|
||||
from django.apps import AppConfig
|
||||
from django.core import checks
|
||||
|
||||
from .checks import check_daphne_installed
|
||||
except ImportError:
|
||||
pass
|
||||
else:
|
||||
from .checks import check_daphne_installed
|
||||
|
||||
class DaphneConfig(AppConfig):
|
||||
name = "daphne"
|
||||
verbose_name = "Daphne"
|
||||
class DaphneConfig(AppConfig):
|
||||
name = "daphne"
|
||||
verbose_name = "Daphne"
|
||||
|
||||
def ready(self):
|
||||
checks.register(check_daphne_installed, checks.Tags.staticfiles)
|
||||
def ready(self):
|
||||
checks.register(check_daphne_installed, checks.Tags.staticfiles)
|
||||
|
|
Loading…
Reference in New Issue
Block a user