1
0
mirror of https://github.com/django/django.git synced 2025-10-23 21:59:11 +00:00

[6.0.x] Cautioned against multi-level relative imports in coding style docs.

Backport of a545eb0c1a from main.
This commit is contained in:
lyova24
2025-10-05 04:28:46 +07:00
committed by Jacob Walls
parent 12e3aa452a
commit 50d31aeb49

View File

@@ -150,8 +150,9 @@ Imports
other Django components, local Django component, try/excepts. Sort lines in
each group alphabetically by 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 relative
imports for local components.
section. Use absolute imports for other Django components and a one-dot
relative import (``from .foo import Bar``) for local components. Avoid
multi-dot relative imports.
* On each line, alphabetize the items with the upper case items grouped before
the lowercase items.