-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Django. Embedded mode support improved
- Loading branch information
Showing
4 changed files
with
43 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,24 @@ | ||
from django.apps import AppConfig | ||
from django.utils.module_loading import autodiscover_modules | ||
from django.utils.translation import gettext_lazy as _ | ||
|
||
from .settings import MODULE_INIT | ||
|
||
|
||
class UwsgifyConfig(AppConfig): | ||
|
||
name = 'uwsgiconf.contrib.django.uwsgify' | ||
verbose_name = _('uWSGI Integration') | ||
|
||
def ready(self): | ||
|
||
try: | ||
import uwsgi | ||
|
||
# This will handle init modules discovery for non-embedded. | ||
# Part for embedding is done in toolbox.SectionMutator.mutate | ||
# via in master process import. | ||
autodiscover_modules(MODULE_INIT) | ||
|
||
except ImportError: | ||
pass |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters