mirror of
https://github.com/django/django.git
synced 2025-10-28 16:16:12 +00:00
Fixed #21714 -- Moved logging configuration to global setup()
Thanks Aymeric Augustin for the report and the review.
This commit is contained in:
@@ -9,8 +9,13 @@ def get_version(*args, **kwargs):
|
||||
|
||||
|
||||
def setup():
|
||||
# Configure the settings (this happens as a side effect of accessing
|
||||
# INSTALLED_APPS or any other setting) and populate the app registry.
|
||||
"""
|
||||
Configure the settings (this happens as a side effect of accessing the
|
||||
first setting), configure logging and populate the app registry.
|
||||
"""
|
||||
from django.apps import apps
|
||||
from django.conf import settings
|
||||
from django.utils.log import configure_logging
|
||||
|
||||
configure_logging(settings.LOGGING_CONFIG, settings.LOGGING)
|
||||
apps.populate(settings.INSTALLED_APPS)
|
||||
|
||||
Reference in New Issue
Block a user