ソースを参照

Document properly specifying forked app in "INSTALLED_APPS"

master
Joseph Wayodi 4年前
コミット
f8e1439bf1
1個のファイルの変更14行の追加0行の削除
  1. 14
    0
      docs/source/topics/customisation.rst

+ 14
- 0
docs/source/topics/customisation.rst ファイルの表示

95
             'yourappsfolder.dashboard.reports.apps.ReportsDashboardConfig',
95
             'yourappsfolder.dashboard.reports.apps.ReportsDashboardConfig',
96
         ]
96
         ]
97
 
97
 
98
+.. note::
99
+
100
+    It is recommended to use the dotted Python path to the app config class,
101
+    rather than to the app package (e.g. ``yourappsfolder.order.apps.OrderConfig``
102
+    instead of ``yourappsfolder.order``).
103
+
104
+    This is to work around a `problem`_ in the way Django's automatic
105
+    ``AppConfig`` discovery (introduced in version 3.2) scans for ``AppConfig``
106
+    subclasses in an app's ``apps.py`` module (in short, it finds all
107
+    ``AppConfig`` subclasses in the ``apps.py``, including ones imported to be
108
+    subclassed). Specifying the path to the app config class ensures that
109
+    automatic ``AppConfig`` discovery is not used at all.
110
+
111
+.. _`problem`: https://code.djangoproject.com/ticket/33013
98
 
112
 
99
 Start customising!
113
 Start customising!
100
 ==================
114
 ==================

読み込み中…
キャンセル
保存