43
Django 1.10にアップグレードした後、エラーrender_to_response() got an unexpected keyword argument 'context_instance'
が表示されます。Djangoエラー:render_to_response()は予期しないキーワード引数 'context_instance'を持っています
次のように私の見解は次のとおりです。ここで
from django.shortcuts import render_to_response
from django.template import RequestContext
def my_view(request):
context = {'foo': 'bar'}
return render_to_response('my_template.html', context, context_instance=RequestContext(request))
はフルトレースバックです:
Traceback:
File "/Users/alasdair/.virtualenvs/django110/lib/python2.7/site-packages/django/core/handlers/exception.py" in inner
39. response = get_response(request)
File "/Users/alasdair/.virtualenvs/django110/lib/python2.7/site-packages/django/core/handlers/base.py" in _get_response
187. response = self.process_exception_by_middleware(e, request)
File "/Users/alasdair/.virtualenvs/django110/lib/python2.7/site-packages/django/core/handlers/base.py" in _get_response
185. response = wrapped_callback(request, *callback_args, **callback_kwargs)
File "/Users/alasdair/dev/rtr/rtr/urls.py" in my_view
26. return render_to_response('my_template.html', context, context_instance=RequestContext(request))
Exception Type: TypeError at/
Exception Value: render_to_response() got an unexpected keyword argument 'context_instance'