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

来源:2-8 资源获取方式和提问方式

慕粉1757246390

2020-01-08

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回答

慕粉1757246390

提问者

2020-01-15

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

0
0

慕粉1757246390

提问者

2020-01-12

我的qq号是374812834,谢谢,

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

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

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

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

麻烦老师了

0
0

bobby

2020-01-10

你留下qq 我加你看看

0
1
慕粉1757246390
我的qq号是374812834,谢谢, 我看到不管xadmin模块,还是其他模块都没有加载,如goods, users, trade等; 如xadmin路径应该是import xadmin.views,但代码是import xadmin goods下面没有views,但加载路径是import goods.views。 其他类似,不知道是我代码使用方法问题,还是其他问题。 麻烦老师了
2020-01-12
共1条回复

Python前后端分离开发Vue+Django REST framework实战

Django REST framework课程视频,RESTFul API前后端分离开发

2872 学习 · 2457 问题

查看课程