Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

django启动后进入首页就报错 #27

Open
xiaolongma88 opened this issue May 9, 2022 · 1 comment
Open

django启动后进入首页就报错 #27

xiaolongma88 opened this issue May 9, 2022 · 1 comment

Comments

@xiaolongma88
Copy link

Internal Server Error: /
Traceback (most recent call last):
File "C:\Users*.virtualenvs\HelloDjango-blog-tutorial-master-e9gKEtdG\lib\site-packages\django\core\handlers\exception.py", line 34, in inner
response = get_response(request)
File "C:\Users*
.virtualenvs\HelloDjango-blog-tutorial-master-e9gKEtdG\lib\site-packages\django\core\handlers\base.py", line 145, in _get_response
response = self.process_exception_by_middleware(e, request)
File "C:\Users*.virtualenvs\HelloDjango-blog-tutorial-master-e9gKEtdG\lib\site-packages\django\core\handlers\base.py", line 143, in _get_response
response = response.render()
File "C:\Users*
.virtualenvs\HelloDjango-blog-tutorial-master-e9gKEtdG\lib\site-packages\django\template\response.py", line 106, in render
self.content = self.rendered_content
File "C:\Users*.virtualenvs\HelloDjango-blog-tutorial-master-e9gKEtdG\lib\site-packages\django\template\response.py", line 83, in rendered_content
content = template.render(context, self._request)
File "C:\Users*
.virtualenvs\HelloDjango-blog-tutorial-master-e9gKEtdG\lib\site-packages\django\template\backends\django.py", line 61, in render
return self.template.render(context)
File "C:\Users*.virtualenvs\HelloDjango-blog-tutorial-master-e9gKEtdG\lib\site-packages\django\template\base.py", line 171, in render
return self._render(context)
File "C:\Users*
.virtualenvs\HelloDjango-blog-tutorial-master-e9gKEtdG\lib\site-packages\django\template\base.py", line 163, in _render
return self.nodelist.render(context)
File "C:\Users*.virtualenvs\HelloDjango-blog-tutorial-master-e9gKEtdG\lib\site-packages\django\template\base.py", line 937, in render
bit = node.render_annotated(context)
File "C:\Users
*.virtualenvs\HelloDjango-blog-tutorial-master-e9gKEtdG\lib\site-packages\django\template\base.py", line 904, in render_annotated
return self.render(context)
File "C:\Users*.virtualenvs\HelloDjango-blog-tutorial-master-e9gKEtdG\lib\site-packages\django\template\loader_tags.py", line 150, in render
return compiled_parent._render(context)
File "C:\Users*
.virtualenvs\HelloDjango-blog-tutorial-master-e9gKEtdG\lib\site-packages\django\template\base.py", line 163, in _render
return self.nodelist.render(context)
File "C:\Users*.virtualenvs\HelloDjango-blog-tutorial-master-e9gKEtdG\lib\site-packages\django\template\base.py", line 937, in render
bit = node.render_annotated(context)
File "C:\Users*
.virtualenvs\HelloDjango-blog-tutorial-master-e9gKEtdG\lib\site-packages\django\template\base.py", line 904, in render_annotated
return self.render(context)
File "C:\Users*.virtualenvs\HelloDjango-blog-tutorial-master-e9gKEtdG\lib\site-packages\django\template\loader_tags.py", line 62, in render
result = block.nodelist.render(context)
File "C:\Users*
.virtualenvs\HelloDjango-blog-tutorial-master-e9gKEtdG\lib\site-packages\django\template\base.py", line 937, in render
bit = node.render_annotated(context)
File "C:\Users*.virtualenvs\HelloDjango-blog-tutorial-master-e9gKEtdG\lib\site-packages\django\template\base.py", line 904, in render_annotated
return self.render(context)
File "C:\Users*
.virtualenvs\HelloDjango-blog-tutorial-master-e9gKEtdG\lib\site-packages\django\template\defaulttags.py", line 309, in render
return nodelist.render(context)
File "C:\Users*.virtualenvs\HelloDjango-blog-tutorial-master-e9gKEtdG\lib\site-packages\django\template\base.py", line 937, in render
bit = node.render_annotated(context)
File "C:\Users*
.virtualenvs\HelloDjango-blog-tutorial-master-e9gKEtdG\lib\site-packages\django\template\base.py", line 904, in render_annotated
return self.render(context)
File "C:\Users*.virtualenvs\HelloDjango-blog-tutorial-master-e9gKEtdG\lib\site-packages\django\template\base.py", line 987, in render
output = self.filter_expression.resolve(context)
File "C:\Users*
.virtualenvs\HelloDjango-blog-tutorial-master-e9gKEtdG\lib\site-packages\django\template\base.py", line 671, in resolve
obj = self.var.resolve(context)
File "C:\Users*.virtualenvs\HelloDjango-blog-tutorial-master-e9gKEtdG\lib\site-packages\django\template\base.py", line 796, in resolve
value = self._resolve_lookup(context)
File "C:\Users*
.virtualenvs\HelloDjango-blog-tutorial-master-e9gKEtdG\lib\site-packages\django\template\base.py", line 858, in _resolve_lookup
current = current()
File "C:\Users*.virtualenvs\HelloDjango-blog-tutorial-master-e9gKEtdG\lib\site-packages\pure_pagination\paginator.py", line 212, in render
return render_to_string('pure_pagination/pagination.html', {
File "C:\Users*
.virtualenvs\HelloDjango-blog-tutorial-master-e9gKEtdG\lib\site-packages\django\template\loader.py", line 62, in render_to_string
return template.render(context, request)
File "C:\Users*.virtualenvs\HelloDjango-blog-tutorial-master-e9gKEtdG\lib\site-packages\django\template\backends\django.py", line 61, in render
return self.template.render(context)
File "C:\Users*
.virtualenvs\HelloDjango-blog-tutorial-master-e9gKEtdG\lib\site-packages\django\template\base.py", line 171, in render
return self._render(context)
File "C:\Users*.virtualenvs\HelloDjango-blog-tutorial-master-e9gKEtdG\lib\site-packages\django\template\base.py", line 163, in _render
return self.nodelist.render(context)
File "C:\Users*
.virtualenvs\HelloDjango-blog-tutorial-master-e9gKEtdG\lib\site-packages\django\template\base.py", line 937, in render
bit = node.render_annotated(context)
File "C:\Users*.virtualenvs\HelloDjango-blog-tutorial-master-e9gKEtdG\lib\site-packages\django\template\base.py", line 904, in render_annotated
return self.render(context)
File "C:\Users*
.virtualenvs\HelloDjango-blog-tutorial-master-e9gKEtdG\lib\site-packages\django\template\defaulttags.py", line 161, in render
values = self.sequence.resolve(context, ignore_failures=True)
File "C:\Users*.virtualenvs\HelloDjango-blog-tutorial-master-e9gKEtdG\lib\site-packages\django\template\base.py", line 671, in resolve
obj = self.var.resolve(context)
File "C:\Users*
.virtualenvs\HelloDjango-blog-tutorial-master-e9gKEtdG\lib\site-packages\django\template\base.py", line 796, in resolve
value = self._resolve_lookup(context)
File "C:\Users*.virtualenvs\HelloDjango-blog-tutorial-master-e9gKEtdG\lib\site-packages\django\template\base.py", line 858, in _resolve_lookup
current = current()
File "C:\Users*
.virtualenvs\HelloDjango-blog-tutorial-master-e9gKEtdG\lib\site-packages\pure_pagination\paginator.py", line 105, in wrapper
elif isinstance(result, collections.Iterable):
AttributeError: module 'collections' has no attribute 'Iterable'

@HiddenPowerIce
Copy link

django版本不对,作者用的是旧版本,新版可能有不兼容的地方
错误信息提示elif isinstance(result, collections.Iterable)这里要改成elif isinstance(result, collections.abc.Iterable)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants