-1
即使對象是在分貝,我得到500錯誤。錯誤是:對象是在分貝 - 但我仍然越來越500 - django
IndexError: string index out of range
錯誤路線是:
location = Location.objects.get(id=lid)
return render_to_response('location.html',{'location':location},context_instance=RequestContext(request))
這是全視圖功能:
def location(request,locname,lid):
try:
location = Location.objects.get(id=lid)
return render_to_response('location.html',{'location':location},context_instance=RequestContext(request))
except Location.DoesNotExist:
return render_to_response('404.html',{},context_instance=RequestContext(request))
這是錯誤回溯:http://pastebin.com/v0ACzRBj
我是什麼做錯了?事情是,在相同的形式其他地點罰款。我可以打開他們的配置文件,但只有兩個位置配置文件給出500錯誤。
500只是一個服務器錯誤。它可能在代碼中存在另一個問題。我不認爲這可以在這個代碼上進行調試。可能需要看更多。 –
你可以添加更多的細節?這不是數據庫查詢的問題,如果它不存在,你會得到一個Location.DoesNotExist。 – Simon
也許顯示你的整個視圖功能。 –