Now we have to use import.
from custom_app.api import xxx
xxx()
I like use custom_app.api.xxx
, it shows Error module 'custom_app' has no attribute 'api'
Now we have to use import.
from custom_app.api import xxx
xxx()
I like use custom_app.api.xxx
, it shows Error module 'custom_app' has no attribute 'api'
check path is correct or not. and also check the in api.py hax a xxx method or not.
Thanks for help! my file is correct.
custom_app.api #first time: show attr err
import custom_app.api #ok
custom_app.api #ok. because imported manually.
I don’t want to import manually.
add from . import api
to custom_app/__init__.py
, works well.