File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -11,7 +11,6 @@ schema closer to your API.
1111 Sane fallbacks are used wherever possible and some warnings might not even be relevant to you.
1212 The remaining issues can be solved with the following steps.
1313
14-
1514Step 1: ``queryset `` and ``serializer_class ``
1615---------------------------------------------
1716Introspection heavily relies on those two attributes. ``get_serializer_class() ``
@@ -148,6 +147,13 @@ All extensions work on the same principle. You provide a ``target_class`` (impor
148147string or actual class) and then state what `drf-spectcular ` should use instead of what
149148it would normally discover.
150149
150+ .. note :: The extensions register themselves automatically. Just be sure that the Python
151+ interpreter sees them at least once.
152+ To that end, we suggest creating a ``PROJECT/schema.py `` file and importing it in your
153+ ``PROJECT/__init__.py `` (same directory as ``settings.py `` and ``urls.py ``)
154+ with ``import PROJECT.schema ``. Please do not import the file in
155+ ``settings.py `` as this may potentially lead to cyclic import issues. Now you are all set.
156+
151157.. note :: Only the first Extension matching the criteria is used. By setting the ``priority`` attribute
152158 on your extension, you can influence the matching order (default ``0 ``).
153159 Built-in Extensions have a priority of ``-1 ``. If you subclass built-in Extensions, don't forget to
You can’t perform that action at this time.
0 commit comments