我按照教程使用python安装django的分页设置。当我试图在视图.py当我试图加载相关模板时,我收到一个“识别错误”。在
我可以在不声明分页器的情况下进行分页视图.py,但我想自定义页面设置。在
我在我的视图.py我相信我在我的设置.py文件夹。我知道我没有把声明打错,因为它只是一句简单的话:
c = RequestContext(request, { "test": testObj, })
p = Paginator (testObj, 100)
return HttpResponse(t.render(c))
是什么导致了这个错误?在
错误:
IndentationError at /result/
unexpected indent (views.py, line 90)
Request Method: GET
Request URL: http://127.0.0.1:8000/result/xxx
Django Version: 1.5
Exception Type: IndentationError
Exception Value:
unexpected indent (views.py, line 90)
Exception Location: C:\Python27\lib\site-packages\django\utils\importlib.py in import_module, line 35
Python Executable: C:\Python27\python.exe
Python Version: 2.7.3
Python Path:
['C:\\Users\\xxx\\Desktop\\xxx',
'C:\\Python27\\lib\\site-packages\\django_pagination-1.0.7-py2.7.egg',
'C:\\Windows\\system32\\python27.zip',
'C:\\Python27\\DLLs',
'C:\\Python27\\lib',
'C:\\Python27\\lib\\plat-win',
'C:\\Python27\\lib\\lib-tk',
'C:\\Python27',
'C:\\Python27\\lib\\site-packages']
Server time: Fri, 22 Mar 2013 14:38:29 -0400
我不确定您使用的是什么文本编辑器,但在gedit中,您可以将制表符和/或空格显示为箭头,这有助于轻松地检测是否有离群的制表符和/或空格。在
相关问题 更多 >
编程相关推荐