АА
Size: a a a
АА
IK
АА
S🇷
IK
IK
M
from app_name.models import thisfrom .models import thisS
from app_name.models import thisfrom .models import thisBE
S
S
S
BE
S
AO
from app_name.models import thisfrom .models import thisAbsolute or Relative imports?(source: https://github.com/phalt/django-api-domains/blob/master/docs/styleguide.md#absolute-or-relative-imports)
The ruling for absolute or relative imports is as follows:
When importing files within a domain, you must use relative imports.
When importing other domains in the same project, you must use absolute imports.
When importing domains in tests, you should use absolute imports.
When importing third-party packages you should use absolute imports.
TL;DR - relative imports inside a domain, absolute for everything else!
With this ruling domains are easy to package and move around. When it comes time to move it into it's own project; tidying up imports will be one less thing you have to do.
BE
S
BE
BE