我想要導入0123.zg中PUSH_NOTIFICATIONS_SETTINGS的setting.py中的應用程序模型。這是我的代碼:Django設置 - 應用程序尚未加載
INSTALLED_APPS = (
....
'my_app',
'push_notifications'
....
)
from my_app.models import User
PUSH_NOTIFICATIONS_SETTINGS = {
'GCM_API_KEY': 'xxxxx',
'APNS_CERTIFICATE': 'xxxxx.pem',
'USER_MODEL': User, # i want to change the default from auth_user to my_app User
}
但它在這一行引發錯誤:
from my_app.models import User
的錯誤是:
django.core.exceptions.AppRegistryNotReady: Apps aren't loaded yet.
我怎樣才能加載程序my_app模型setting.py?