渲染时出现 TemplateSyntaxError / Caught IOError:(13,“权限被拒绝”)
页面上显示的这个错误
TracebackFile
"/usr/local/lib64/python2.6/site-packages/django/core/handlers/base.py" in get_response
111. response = callback(request, *callback_args, **callback_kwargs)
File "/usr/local/lib64/python2.6/site-packages/django/views/generic/simple.py" in direct_to_template
28. return HttpResponse(t.render(c), mimetype=mimetype)
File "/usr/local/lib64/python2.6/site-packages/django/template/base.py" in render
123. return self._render(context)
File "/usr/local/lib64/python2.6/site-packages/django/template/base.py" in _render
117. return self.nodelist.render(context)
File "/usr/local/lib64/python2.6/site-packages/django/template/base.py" in render
744. bits.append(self.render_node(node, context))
File "/usr/local/lib64/python2.6/site-packages/django/template/debug.py" in render_node
73. result = node.render(context)
File "/usr/local/lib64/python2.6/site-packages/django/template/loader_tags.py" in render
127. return compiled_parent._render(context)
File "/usr/local/lib64/python2.6/site-packages/django/template/base.py" in _render
117. return self.nodelist.render(context)
File "/usr/local/lib64/python2.6/site-packages/django/template/base.py" in render
744. bits.append(self.render_node(node, context))
File "/usr/local/lib64/python2.6/site-packages/django/template/debug.py" in render_node
73. result = node.render(context)
File "/usr/local/lib64/python2.6/site-packages/django/template/loader_tags.py" in render
64. result = block.nodelist.render(context)
File "/usr/local/lib64/python2.6/site-packages/django/template/base.py" in render
744. bits.append(self.render_node(node, context))
File "/usr/local/lib64/python2.6/site-packages/django/template/debug.py" in render_node
73. result = node.render(context)
File "/usr/local/lib64/python2.6/site-packages/django/template/defaulttags.py" in render
313. return self.nodelist_false.render(context)
File "/usr/local/lib64/python2.6/site-packages/django/template/base.py" in render
744. bits.append(self.render_node(node, context))
File "/usr/local/lib64/python2.6/site-packages/django/template/debug.py" in render_node
73. result = node.render(context)
File "/usr/local/lib64/python2.6/site-packages/django/template/defaulttags.py" in render
437. url = reverse(view_name, args=args, kwargs=kwargs, current_app=context.current_app)
File "/usr/local/lib64/python2.6/site-packages/django/core/urlresolvers.py" in reverse
391. *args, **kwargs)))
File "/usr/local/lib64/python2.6/site-packages/django/core/urlresolvers.py" in reverse
312. possibilities = self.reverse_dict.getlist(lookup_view)
File "/usr/local/lib64/python2.6/site-packages/django/core/urlresolvers.py" in _get_reverse_dict
229. self._populate()
File "/usr/local/lib64/python2.6/site-packages/django/core/urlresolvers.py" in _populate
208. for name in pattern.reverse_dict:
File "/usr/local/lib64/python2.6/site-packages/django/core/urlresolvers.py" in _get_reverse_dict
229. self._populate()
File "/usr/local/lib64/python2.6/site-packages/django/core/urlresolvers.py" in _populate
220. lookups.appendlist(pattern.callback, (bits, p_pattern))
File "/usr/local/lib64/python2.6/site-packages/django/core/urlresolvers.py" in _get_callback
164. self._callback = get_callable(self._callback_str)
File "/usr/local/lib64/python2.6/site-packages/django/utils/functional.py" in wrapper
124. result = func(*args)
File "/usr/local/lib64/python2.6/site-packages/django/core/urlresolvers.py" in get_callable
91. lookup_view = getattr(import_module(mod_name), func_name)
File "/usr/local/lib64/python2.6/site-packages/django/utils/importlib.py" in import_module
35. __import__(name)
File "/usr/lib64/python2.6/logging/__init__.py" in __init__
790. stream = self._open()
File "/usr/lib64/python2.6/logging/__init__.py" in _open
810. stream = open(self.baseFilename, self.mode)
Exception Type: TemplateSyntaxError at /
Exception Value: Caught IOError while rendering: (13, 'Permission denied')
是什么意思?我该如何解决它?
This is the error shown on the page
TracebackFile
"/usr/local/lib64/python2.6/site-packages/django/core/handlers/base.py" in get_response
111. response = callback(request, *callback_args, **callback_kwargs)
File "/usr/local/lib64/python2.6/site-packages/django/views/generic/simple.py" in direct_to_template
28. return HttpResponse(t.render(c), mimetype=mimetype)
File "/usr/local/lib64/python2.6/site-packages/django/template/base.py" in render
123. return self._render(context)
File "/usr/local/lib64/python2.6/site-packages/django/template/base.py" in _render
117. return self.nodelist.render(context)
File "/usr/local/lib64/python2.6/site-packages/django/template/base.py" in render
744. bits.append(self.render_node(node, context))
File "/usr/local/lib64/python2.6/site-packages/django/template/debug.py" in render_node
73. result = node.render(context)
File "/usr/local/lib64/python2.6/site-packages/django/template/loader_tags.py" in render
127. return compiled_parent._render(context)
File "/usr/local/lib64/python2.6/site-packages/django/template/base.py" in _render
117. return self.nodelist.render(context)
File "/usr/local/lib64/python2.6/site-packages/django/template/base.py" in render
744. bits.append(self.render_node(node, context))
File "/usr/local/lib64/python2.6/site-packages/django/template/debug.py" in render_node
73. result = node.render(context)
File "/usr/local/lib64/python2.6/site-packages/django/template/loader_tags.py" in render
64. result = block.nodelist.render(context)
File "/usr/local/lib64/python2.6/site-packages/django/template/base.py" in render
744. bits.append(self.render_node(node, context))
File "/usr/local/lib64/python2.6/site-packages/django/template/debug.py" in render_node
73. result = node.render(context)
File "/usr/local/lib64/python2.6/site-packages/django/template/defaulttags.py" in render
313. return self.nodelist_false.render(context)
File "/usr/local/lib64/python2.6/site-packages/django/template/base.py" in render
744. bits.append(self.render_node(node, context))
File "/usr/local/lib64/python2.6/site-packages/django/template/debug.py" in render_node
73. result = node.render(context)
File "/usr/local/lib64/python2.6/site-packages/django/template/defaulttags.py" in render
437. url = reverse(view_name, args=args, kwargs=kwargs, current_app=context.current_app)
File "/usr/local/lib64/python2.6/site-packages/django/core/urlresolvers.py" in reverse
391. *args, **kwargs)))
File "/usr/local/lib64/python2.6/site-packages/django/core/urlresolvers.py" in reverse
312. possibilities = self.reverse_dict.getlist(lookup_view)
File "/usr/local/lib64/python2.6/site-packages/django/core/urlresolvers.py" in _get_reverse_dict
229. self._populate()
File "/usr/local/lib64/python2.6/site-packages/django/core/urlresolvers.py" in _populate
208. for name in pattern.reverse_dict:
File "/usr/local/lib64/python2.6/site-packages/django/core/urlresolvers.py" in _get_reverse_dict
229. self._populate()
File "/usr/local/lib64/python2.6/site-packages/django/core/urlresolvers.py" in _populate
220. lookups.appendlist(pattern.callback, (bits, p_pattern))
File "/usr/local/lib64/python2.6/site-packages/django/core/urlresolvers.py" in _get_callback
164. self._callback = get_callable(self._callback_str)
File "/usr/local/lib64/python2.6/site-packages/django/utils/functional.py" in wrapper
124. result = func(*args)
File "/usr/local/lib64/python2.6/site-packages/django/core/urlresolvers.py" in get_callable
91. lookup_view = getattr(import_module(mod_name), func_name)
File "/usr/local/lib64/python2.6/site-packages/django/utils/importlib.py" in import_module
35. __import__(name)
File "/usr/lib64/python2.6/logging/__init__.py" in __init__
790. stream = self._open()
File "/usr/lib64/python2.6/logging/__init__.py" in _open
810. stream = open(self.baseFilename, self.mode)
Exception Type: TemplateSyntaxError at /
Exception Value: Caught IOError while rendering: (13, 'Permission denied')
What does it mean? how can i solve it?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
时出现文件权限问题
通常,这可能是在将do
chmod 777 -R
渲染到模板目录。或者你升级了 django 版本吗?
Normally this could be the file permission problem while rendering
do
chmod 777 -R
to your template directory.Or Did you upgraded your django version?
运行 Apache 的用户没有写入 /tmp/ 目录的权限。
我建议的方法如下:
The user, Apache is running under, has no permissions to write into your /tmp/ directory.
My suggested approach for it would be following: