... り取りを必要とすることがあります。そのため、アプリケーションレジストリは、インストール済みアプリケーションごとのメタデータを AppConfig インスタンスに保持しています。 プロジェクトパッケージがアプリケーションとみなされず、モデルなどを持てないといった制限はあり ... )。 アプリケーションを設定する アプリケーションを設定するためには、アプリケーション内に apps.py モジュールを作成し、そこに AppConfig のサブクラスを定義してください。 INSTALLED_APPS にアプリケーションモジュールへのドット区切りパスが含まれている場合、デフォ ... ルトでは、 Django が apps.py サブモジュールの中に AppConfig サブクラスをちょうど 1 つ見つけると、その設定をアプリケーションに使用します。この動作は AppConfig.default を False に設定す ... ... ジョン系列の最新リリースのみを公式にサポートし、最新リリースを使用することを 強く推奨 します。 Django 3.2 の新機能 Automatic AppConfig discovery Most pluggable applications define an AppConfig subclass in an apps.py submodule. Many define a default_app_conf ... ig variable pointing to this class in their __init__.py . When the apps.py submodule exists and defines a single AppConfig subclass, Django now uses that configuration automatically, so you can remove default_app_config . default_app_config made ... it possible to declare only the application's path in INSTALLED_APPS (e.g. 'django.contrib.admin' ) rather than the app config's path (e.g. 'django.contrib.admin.apps.AdminConfig' ). It was introduced for backwards-compatibility with the former sty ... ... 常、サードパーティのアプリケーションで使用されることはありません。 このシグナルはアプリ登録プロセス中に送信されます。そして AppConfig.ready() はアプリ登録が完全に終了した後に実行されますので、レシーバーをそのメソッド内で接続することはできません。一つの可能 ... 性としては、 AppConfig.__init__() の中でそれらを接続することですが、モデルをインポートしたり、アプリ登録への呼び出しを触発しないよう注意が必要です ... このシグナルとともに送信される引数は以下の通りです: sender マイグレーションまたは同期される予定のアプリケーションのための AppConfig インスタンスです。 app_config sender と同じ。 verbosity manage.py が画面上にどれだけ情報を表示しているかを示します。詳細に ... ... いる場合に便利です。 例えば、サードパーティのアプリを登録して、設定変更の通知を受けることができます: from django.apps import AppConfig from django.core.signals import setting_changed def my_receiver ( sender , ** kwargs ): print ( "Setting changed!" ) class ... MyAppConfig ( AppConfig ): ... def ready ( self ): setting_changed . connect ( my_receiver ) Django の 組み込みのシグナル は、ユーザコ ... ator, import the signals submodule inside ready() , this will implicitly connect signal receivers: from django.apps import AppConfig from django.core.signals import request_finished class MyAppConfig ( AppConfig ): ... def ready ( self ): # Implicitly con ... ... ions の属性) app_name (ResolverMatch の属性) app_names (ResolverMatch の属性) AppCommand (django.core.management のクラス) AppConfig (django.apps のクラス) APPEND_SLASH setting appendlist() (QueryDict のメソッド) AppRegistryNotReady apps (django.apps モジ ... rom_middleware_with_args() (django.utils.decorators モジュール) decr() (cache のメソッド) default template filter default (AppConfig の属性) (Field の属性) DEFAULT_AUTO_FIELD setting default_auto_field (AppConfig の属性) default_bounds (DateTimeRangeField ... template tag get_messages() (django.contrib.messages モジュール) get_min_num() (InlineModelAdmin のメソッド) get_model() (AppConfig のメソッド) (apps のメソッド) get_model_admin() (AdminSite のメソッド) get_model_class() (backends.db.SessionStore のクラス ... ... hanges to DEFAULT_AUTO_FIELD made by users of your reusable app: django-polls/django_polls/apps.py from django.apps import AppConfig class PollsConfig ( AppConfig ): default_auto_field = "django.db.models.BigAutoField" name = "django_polls" label = "polls ... ... template's settings.py contained: DEFAULT_AUTO_FIELD = "django.db.models.BigAutoField" and the default startapp template's AppConfig contained: default_auto_field = "django.db.models.BigAutoField" At that time, the default value of DEFAULT_AUTO_FIELD rema ... 'django.db.models.AutoField' to your project's settings, or default_auto_field = 'django.db.models.AutoField' to an app's AppConfig , as needed. Custom ORM expressions should return params as a tuple Prior to Django 6.0, custom lookups and custom express ... ... 't always work correctly, but didn't crash outright either. If you have two apps with the same label, you should create an AppConfig for one of them and override its label there. You should then adjust your code wherever it references this application or ... Subclasses of AppCommand must now implement a handle_app_config() method instead of handle_app() . This method receives an AppConfig instance instead of a models module. Introspecting applications Since INSTALLED_APPS now supports application configuratio ... ... 必要があります。チェックは、アプリケーションが読み込まれるときに読み込まれるファイル内に登録される必要があります。たとえば、 AppConfig.ready() メソッド内などです。 register ( *tags)(function ) register には、チェックにラベルを付けるために必要な数のタグを渡す ... ... 成するならば、それ以前にルックアップの登録を行っておく必要があります。実装する場所は models.py ファイル内で行ってもよいし、 AppConfig 内の ready() メソッドにてルックアップの登録を行うのでも構いません。 実装の詳細について見ると、最初に必要な属性は lookup_na ... 2026年10月08日