title: python 3.6 JsonResponse issue
body: <p>So i recently migrated to Python 3.6 and Django 1.11 and my JsonResponse code looked like this:</p>
  
  <pre><code>   return JsonResponse({'status': '1'}) 
  </code></pre>
  
  <p>it worked fine but after the migration i started getting this error:</p>
  
  <blockquote>
    <p>TypeError: Object of type 'bytes' is not JSON serializable</p>
  </blockquote>
  
  <p>After printing the type of the data passed to JsonResponse i realized python 3.6 changed this from dict to byte.
  So i changed the code to make sure i was passing a dict.</p>
  
  <p>I still get the same error after trying all of this:</p>
  
  <pre><code>    data = dict([('status', 0)])
      print(data)
      print(type(data))
      # print(type(json.dumps(data)))
      # data = {"status": '0'}
      # data = json.dumps(data)
      # json.dumps(data.decode("utf-8"))
      #response = json.JSONEncoder().encode({"status": 0}) 
      #JsonResponse(data, safe=False)
      # response = json.dumps(data)
      print(JsonResponse(data, safe=False))
      return JsonResponse(data, safe=False)
  </code></pre>
  
  <p>Prints:</p>
  
  <pre><code>    {'status': 0}
      &lt;class 'dict'&gt;
      &lt;JsonResponse status_code=200, "application/json"&gt;
  </code></pre>
  
  <p>with the json.dumps options y get this error instead</p>
  
  <blockquote>
    <p>AttributeError: 'str' object has no attribute 'get'</p>
  </blockquote>
  
  <p>Any help would be much appreciated </p>
  
  <p>Traceback</p>
  
  <pre><code>    Traceback (most recent call last):
      File "/Users/andresvillavicencio/bancompara.mx/lib/python3.6/site-packages/django/core/handlers/base.py", line 131, in get_response
      response = middleware_method(request, response)
      File "/Users/andresvillavicencio/bancompara.mx/lib/python3.6/site-packages/django/contrib/sessions/middleware.py", line 58, in process_response
  request.session.save()
      File "/Users/andresvillavicencio/bancompara.mx/lib/python3.6/site-packages/django/contrib/sessions/backends/db.py", line 81, in save
  return self.create()
      File "/Users/andresvillavicencio/bancompara.mx/lib/python3.6/site-packages/django/contrib/sessions/backends/db.py", line 54, in create
  self.save(must_create=True)
      File "/Users/andresvillavicencio/bancompara.mx/lib/python3.6/site-packages/django/contrib/sessions/backends/db.py", line 83, in save
  obj = self.create_model_instance(data)
      File "/Users/andresvillavicencio/bancompara.mx/lib/python3.6/site-packages/django/contrib/sessions/backends/db.py", line 69, in create_model_instance
  session_data=self.encode(data),
      File "/Users/andresvillavicencio/bancompara.mx/lib/python3.6/site-packages/django/contrib/sessions/backends/base.py", line 98, in encode
  serialized = self.serializer().dumps(session_dict)
      File "/Users/andresvillavicencio/bancompara.mx/lib/python3.6/site-packages/django/core/signing.py", line 93, in dumps
  return json.dumps(obj, separators=(',', ':')).encode('latin-1')
      File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/json/__init__.py", line 238, in dumps
  **kw).encode(obj)
      File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/json/encoder.py", line 199, in encode
  chunks = self.iterencode(o, _one_shot=True)
      File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/json/encoder.py", line 257, in iterencode
  return _iterencode(o, 0)
      File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/json/encoder.py", line 180, in default
  o.__class__.__name__)
     TypeError: Object of type 'bytes' is not JSON serializable
  </code></pre>