from .models import UserProfile
来源:6-3 用户登录-2
 
			何杨233
2017-12-01
只要是加上from .models import UserProfile 这个引用 就会报错  查了2小时没查出来原因
"application was loaded. " % (module, name))
RuntimeError: Model class apps.users.models.UserProfile doesn't declare an explicit app_label and either isn't in an application in INSTALLED_APPS or else was imported before its application was loaded.
- 需要安装的库都安装了(future,six等) 
- 已经把apps目录mark成sourceroot了 
- 在setting里配置了base_dir了(sys.path.insert(0, os.path.join(BASE_DIR, 'apps')) 
 )
- users这个app也注册了(INSTALLED_APPS = ( 
 )
写回答
	2回答
- 
				  bobby 2017-12-04 你给我发个qq消息 我给你看看问题 132018-06-28
- 
				  何杨233 提问者 2017-12-04 我现在用的是from apps.users.model import 没保存了 但是不知道为什么不能直接 .model这样引用 032017-12-05
相似问题
