... 照してください。 自動インポートをカスタマイズする ¶ shell 管理コマンドの自動インポート動作をカスタマイズするには、 get_auto_imports() メソッドをオーバーライドします。このメソッドは、アプリケーションで利用可能なオブジェクトまたはモジュールのインポートパス ... のシーケンスを返す必要があります。例えば: polls/management/commands/shell.py ¶ from django.core.management.commands import shell class Command ( shell . Command ): def get_auto_imports ( self ): return super () . get_auto_imports () + [ "django.u ... に表示されます: 13 objects imported automatically: from django.db import connection, reset_queries, models from django.conf import settings from django.contrib.admin.models import LogEntry from django.contrib.auth.models import Group, Permission, User fr ... ... 照してください。 自動インポートをカスタマイズする ¶ shell 管理コマンドの自動インポート動作をカスタマイズするには、 get_auto_imports() メソッドをオーバーライドします。このメソッドは、アプリケーションで利用可能なオブジェクトまたはモジュールのインポートパス ... のシーケンスを返す必要があります。例えば: polls/management/commands/shell.py ¶ from django.core.management.commands import shell class Command ( shell . Command ): def get_auto_imports ( self ): return super () . get_auto_imports () + [ "django.u ... に表示されます: 13 objects imported automatically: from django.db import connection, reset_queries, models from django.conf import settings from django.contrib.admin.models import LogEntry from django.contrib.auth.models import Group, Permission, User fr ... ... {**x, **y} ) or sequences ( [*a, *b] ). This improves performance, readability, and maintainability while reducing errors. Imports ¶ Use isort to automate import sorting using the guidelines below. Quick start: / $ python -m pip install "isort >= 7. ... ort recursively from your current directory, modifying any files that don't conform to the guidelines. If you need to have imports out of order (to avoid a circular import, for example) use a comment like this: import module # isort:skip Put imports in ... y the full module name. Place all import module statements before from module import objects in each section. Use absolute imports for other Django components and a one-dot relative import ( from .foo import Bar ) for local components. Avoid multi-dot r ... ... {**x, **y} ) or sequences ( [*a, *b] ). This improves performance, readability, and maintainability while reducing errors. Imports ¶ Use isort to automate import sorting using the guidelines below. Quick start: / $ python -m pip install "isort >= 7. ... ort recursively from your current directory, modifying any files that don't conform to the guidelines. If you need to have imports out of order (to avoid a circular import, for example) use a comment like this: import module # isort:skip Put imports in ... y the full module name. Place all import module statements before from module import objects in each section. Use absolute imports for other Django components and a one-dot relative import ( from .foo import Bar ) for local components. Avoid multi-dot r ... ... del ( #25299 ). Fixed autocompletion for options of non- argparse management commands ( #25372 ). Alphabetized ordering of imports in from django.db import migrations, models statement in newly created migrations ( #25384 ). Fixed migrations crash on My ... ... del ( #25299 ). Fixed autocompletion for options of non- argparse management commands ( #25372 ). Alphabetized ordering of imports in from django.db import migrations, models statement in newly created migrations ( #25384 ). Fixed migrations crash on My ... ... uage() view is now based on the Accept HTTP header instead of the X-Requested-With HTTP header presence. The compatibility imports of django.core.exceptions.EmptyResultSet in django.db.models.query , django.db.models.sql , and django.db.models.sql.datas ... compatibility import of django.core.exceptions.FieldDoesNotExist in django.db.models.fields is removed. The compatibility imports of django.forms.utils.pretty_name() and django.forms.boundfield.BoundField in django.forms.forms are removed. The compatib ... ility imports of Context , ContextPopException , and RequestContext in django.template.base are removed. The compatibility import of dja ... ... uage() view is now based on the Accept HTTP header instead of the X-Requested-With HTTP header presence. The compatibility imports of django.core.exceptions.EmptyResultSet in django.db.models.query , django.db.models.sql , and django.db.models.sql.datas ... compatibility import of django.core.exceptions.FieldDoesNotExist in django.db.models.fields is removed. The compatibility imports of django.forms.utils.pretty_name() and django.forms.boundfield.BoundField in django.forms.forms are removed. The compatib ... ility imports of Context , ContextPopException , and RequestContext in django.template.base are removed. The compatibility import of dja ... ... ns on how to do this are found in the CSRF docs. All of the CSRF has moved from contrib to core (with backwards compatible imports in the old locations, which are deprecated and will cease to be supported in Django 1.4). get_db_prep_*() methods on Field ... validating email addresses has been moved from django.form.fields to django.core.validators . You will need to update your imports if you are using it. Features deprecated in 1.2 ¶ Finally, Django 1.2 deprecates some features from earlier releases. Thes ... e and CsrfViewMiddleware , has likewise been deprecated. Also, the CSRF module has moved from contrib to core, and the old imports are deprecated, as described in the upgrading notes. Documentation removed The upgrade notes have been removed in current ... ... ns on how to do this are found in the CSRF docs. All of the CSRF has moved from contrib to core (with backwards compatible imports in the old locations, which are deprecated and will cease to be supported in Django 1.4). get_db_prep_*() methods on Field ... validating email addresses has been moved from django.form.fields to django.core.validators . You will need to update your imports if you are using it. Features deprecated in 1.2 ¶ Finally, Django 1.2 deprecates some features from earlier releases. Thes ... e and CsrfViewMiddleware , has likewise been deprecated. Also, the CSRF module has moved from contrib to core, and the old imports are deprecated, as described in the upgrading notes. Documentation removed The upgrade notes have been removed in current ... 2026年10月08日