AttributeError 'tuple' object has no attribute 'get'

前端 未结 3 645
日久生厌
日久生厌 2020-12-30 04:09

I have a Django application. But i can\'t an error that i have been struggling with for some time now.

Exception Value: \'tuple\' object has no attribute \'g         


        
3条回答
  •  我在风中等你
    2020-12-30 04:52

    Even taking the commas of the views is as simple of a solution

    as-in this

    def home(request):
        return render(request, 'index.html')
    
    def hire(request):
        return render(request, 'hire.html')
    
    def handler400(request, exception):
        return render(request, '400.html', locals())
    
    def handler403(request, exception):
        return render(request, '403.html', locals())
    
    def handler404(request, exception):
        return render(request, '404.html', locals())
    
    def handler500(request, exception):
        return render(request, '500.html', locals())
    

    Rather than this

    def home(request):
        return render(request, 'index.html'),
    
    def hire(request):
        return render(request, 'hire.html'),
    
    def handler400(request, exception):
        return render(request, '400.html', locals()),
    
    def handler403(request, exception):
        return render(request, '403.html', locals()),
    
    def handler404(request, exception):
        return render(request, '404.html', locals()),
    
    def handler500(request, exception):
        return render(request, '500.html', locals())
    

提交回复
热议问题