请稍等 ...
×

采纳答案成功!

向帮助你的同学说点啥吧!感谢那些助人为乐的人

安装包后运行出错,发现xadmin没有正常导入,请问怎么解决

Unhandled exception in thread started by <function check_errors..wrapper at 0x05B9C858>
Traceback (most recent call last):
File “D:\install\python-series\Python-3.6.8\lib\site-packages\django\utils\autoreload.py”, line 225, in wrapper
fn(*args, **kwargs)
File “D:\install\python-series\Python-3.6.8\lib\site-packages\django\core\management\commands\runserver.py”, line 120, in inner_run
self.check(display_num_errors=True)
File “D:\install\python-series\Python-3.6.8\lib\site-packages\django\core\management\base.py”, line 364, in check
include_deployment_checks=include_deployment_checks,
File “D:\install\python-series\Python-3.6.8\lib\site-packages\django\core\management\base.py”, line 351, in run_checks
return checks.run_checks(**kwargs)
File “D:\install\python-series\Python-3.6.8\lib\site-packages\django\core\checks\registry.py”, line 73, in run_checks
new_errors = check(app_configs=app_configs)
File “D:\install\python-series\Python-3.6.8\lib\site-packages\django\core\checks\urls.py”, line 13, in check_url_config
return check_resolver(resolver)
File “D:\install\python-series\Python-3.6.8\lib\site-packages\django\core\checks\urls.py”, line 23, in check_resolver
return check_method()
File “D:\install\python-series\Python-3.6.8\lib\site-packages\django\urls\resolvers.py”, line 397, in check
for pattern in self.url_patterns:
File “D:\install\python-series\Python-3.6.8\lib\site-packages\django\utils\functional.py”, line 36, in get
res = instance.dict[self.name] = self.func(instance)
File “D:\install\python-series\Python-3.6.8\lib\site-packages\django\urls\resolvers.py”, line 536, in url_patterns
patterns = getattr(self.urlconf_module, “urlpatterns”, self.urlconf_module)
File “D:\install\python-series\Python-3.6.8\lib\site-packages\django\utils\functional.py”, line 36, in get
res = instance.dict[self.name] = self.func(instance)
File “D:\install\python-series\Python-3.6.8\lib\site-packages\django\urls\resolvers.py”, line 529, in urlconf_module
return import_module(self.urlconf_name)
File "D:\install\python-series\Python-3.6.8\lib\importlib_init
.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File “

Process finished with exit code 0

INSTALLED_APPS = [
‘django.contrib.admin’,
这个在setting.py里面也有。
目前看您授课里面的所有配置和下载的包都已经做到位了,还是报这个错误。

谢谢!

正在回答 回答被采纳积分+3

3回答

提问者 慕粉1757246390 2020-01-15 00:10:57

我知道原因了,是项目没有mark apps 和 extra_apps导致的,我mark directory as source root后import xadmin和goods等其他包就可以了。

0 回复 有任何疑惑可以回复我~
提问者 慕粉1757246390 2020-01-12 22:42:01

我的qq号是374812834,谢谢,

我看到不管xadmin模块,还是其他模块都没有加载,如goods, users, trade等;

如xadmin路径应该是import xadmin.views,但代码是import xadmin

goods下面没有views,但加载路径是import goods.views。

其他类似,不知道是我代码使用方法问题,还是其他问题。

麻烦老师了

0 回复 有任何疑惑可以回复我~
bobby 2020-01-10 11:39:19

你留下qq 我加你看看

0 回复 有任何疑惑可以回复我~
  • 提问者 慕粉1757246390 #1
    我的qq号是374812834,谢谢,
    我看到不管xadmin模块,还是其他模块都没有加载,如goods, users, trade等;
    如xadmin路径应该是import xadmin.views,但代码是import xadmin
    goods下面没有views,但加载路径是import goods.views。
    其他类似,不知道是我代码使用方法问题,还是其他问题。
    麻烦老师了
    回复 有任何疑惑可以回复我~ 2020-01-12 22:42:22
问题已解决,确定采纳
还有疑问,暂不采纳
意见反馈 帮助中心 APP下载
官方微信