mirror of
https://github.com/django/django.git
synced 2024-12-22 17:16:24 +00:00
Made runserver close database connections from migration checks.
This commit is contained in:
parent
daf7d482db
commit
bcccea3ef3
@ -8,6 +8,7 @@ from datetime import datetime
|
|||||||
from django.conf import settings
|
from django.conf import settings
|
||||||
from django.core.management.base import BaseCommand, CommandError
|
from django.core.management.base import BaseCommand, CommandError
|
||||||
from django.core.servers.basehttp import WSGIServer, get_internal_wsgi_application, run
|
from django.core.servers.basehttp import WSGIServer, get_internal_wsgi_application, run
|
||||||
|
from django.db import connections
|
||||||
from django.utils import autoreload
|
from django.utils import autoreload
|
||||||
from django.utils.regex_helper import _lazy_re_compile
|
from django.utils.regex_helper import _lazy_re_compile
|
||||||
|
|
||||||
@ -134,6 +135,9 @@ class Command(BaseCommand):
|
|||||||
# Need to check migrations here, so can't use the
|
# Need to check migrations here, so can't use the
|
||||||
# requires_migrations_check attribute.
|
# requires_migrations_check attribute.
|
||||||
self.check_migrations()
|
self.check_migrations()
|
||||||
|
# Close all connections opened during migration checking.
|
||||||
|
for conn in connections.all(initialized_only=True):
|
||||||
|
conn.close()
|
||||||
|
|
||||||
try:
|
try:
|
||||||
handler = self.get_handler(*args, **options)
|
handler = self.get_handler(*args, **options)
|
||||||
|
Loading…
Reference in New Issue
Block a user