Import strategy in django applications

I would like to know what is the best import strategy in applications for reusing django.

Say I have an application called usefulapp. In my application, I need to access, say, models. Should I use explicit import like:

import usefulapp.models

or just, since I'm inside this application, I could use:

import models

Which one is recommended?

Are there any flaws in using the second approach?

+3
source share
2 answers

, . sys.path , models. , . , , .

+3

, .

, ; - ( , ).

models , , , , . python.

python. Django python ( set_environ(settings)) , , .

+3

Source: https://habr.com/ru/post/1735799/


All Articles