Small performance tweak - avoid loading django.core.management in DB backend code

django.core.management (and dependencies) will usually not be needed in a web context.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@15012 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Luke Plant 2010-12-21 21:32:59 +00:00
parent af5ad1116c
commit 363177ea32
1 changed files with 3 additions and 1 deletions

View File

@ -2,7 +2,6 @@ import sys
import time import time
from django.conf import settings from django.conf import settings
from django.core.management import call_command
# The prefix to put on the default database name when creating # The prefix to put on the default database name when creating
# the test database. # the test database.
@ -338,6 +337,9 @@ class BaseDatabaseCreation(object):
Creates a test database, prompting the user for confirmation if the Creates a test database, prompting the user for confirmation if the
database already exists. Returns the name of the test database created. database already exists. Returns the name of the test database created.
""" """
# Don't import django.core.management if it isn't needed.
from django.core.management import call_command
test_database_name = self._get_test_db_name() test_database_name = self._get_test_db_name()
if verbosity >= 1: if verbosity >= 1: