weixin_60828450 2022-10-17 20:29 采纳率: 0%
浏览 69

关于django出现TypeError: 'module' object is not iterable的错误

在复现农业知识图谱的项目(https://github.com/qq547276542/Agriculture_KnowledgeGraph 中,最后运行django的时候出现这样的错误
kg是conda的虚拟环境,3.6版本的python

(kg) D:\Desktop\test\Agriculture_KnowledgeGraph-master\demo>python manage.py runserver
Watching for file changes with StatReloader
Performing system checks...

Exception in thread django-main-thread:
Traceback (most recent call last):
  File "D:\DevTools\Anaconda3\envs\kg\lib\site-packages\django\urls\resolvers.py", line 604, in url_patterns
    iter(patterns)
TypeError: 'module' object is not iterable

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "D:\DevTools\Anaconda3\envs\kg\lib\threading.py", line 916, in _bootstrap_inner
    self.run()
  File "D:\DevTools\Anaconda3\envs\kg\lib\threading.py", line 864, in run
    self._target(*self._args, **self._kwargs)
  File "D:\DevTools\Anaconda3\envs\kg\lib\site-packages\django\utils\autoreload.py", line 64, in wrapper
    fn(*args, **kwargs)
  File "D:\DevTools\Anaconda3\envs\kg\lib\site-packages\django\core\management\commands\runserver.py", line 118, in inner_run
    self.check(display_num_errors=True)
  File "D:\DevTools\Anaconda3\envs\kg\lib\site-packages\django\core\management\base.py", line 423, in check
    databases=databases,
  File "D:\DevTools\Anaconda3\envs\kg\lib\site-packages\django\core\checks\registry.py", line 76, in run_checks
    new_errors = check(app_configs=app_configs, databases=databases)
  File "D:\DevTools\Anaconda3\envs\kg\lib\site-packages\django\core\checks\urls.py", line 13, in check_url_config
    return check_resolver(resolver)
  File "D:\DevTools\Anaconda3\envs\kg\lib\site-packages\django\core\checks\urls.py", line 23, in check_resolver
    return check_method()
  File "D:\DevTools\Anaconda3\envs\kg\lib\site-packages\django\urls\resolvers.py", line 416, in check
    for pattern in self.url_patterns:
  File "D:\DevTools\Anaconda3\envs\kg\lib\site-packages\django\utils\functional.py", line 48, in __get__
    res = instance.__dict__[self.name] = self.func(instance)
  File "D:\DevTools\Anaconda3\envs\kg\lib\site-packages\django\urls\resolvers.py", line 611, in url_patterns
    raise ImproperlyConfigured(msg.format(name=self.urlconf_name)) from e
django.core.exceptions.ImproperlyConfigured: The included URLconf 'demo.urls' does not appear to have any patterns in it. If you see valid patterns in the file then the issue is probably caused by a circular import.

想问一下该咋办

  • 写回答

1条回答 默认 最新

  • CSDN-Ada助手 CSDN-AI 官方账号 2022-10-17 21:11
    关注
    评论

报告相同问题?

问题事件

  • 创建了问题 10月17日

悬赏问题

  • ¥15 微信小程序协议怎么写
  • ¥15 c语言怎么用printf(“\b \b”)与getch()实现黑框里写入与删除?
  • ¥20 怎么用dlib库的算法识别小麦病虫害
  • ¥15 华为ensp模拟器中S5700交换机在配置过程中老是反复重启
  • ¥15 java写代码遇到问题,求帮助
  • ¥15 uniapp uview http 如何实现统一的请求异常信息提示?
  • ¥15 有了解d3和topogram.js库的吗?有偿请教
  • ¥100 任意维数的K均值聚类
  • ¥15 stamps做sbas-insar,时序沉降图怎么画
  • ¥15 买了个传感器,根据商家发的代码和步骤使用但是代码报错了不会改,有没有人可以看看