title: 'unicode' object has no attribute 'get'
body: <p>I am writing django application and stuck with the error</p>
  
  <pre><code>'unicode' object has no attribute 'get'
  </code></pre>
  
  <p>I saw a lot of questions here but no one matches with mine issue.</p>
  
  <p>The issue is with my method in views.py that should return JSON:</p>
  
  <pre><code>def get_pattern(request, product_id):
      """
      Get JSON for needed pattern
      """
      data = Patterns.objects.get(related_module=product_id)
      product_data = serializers.serialize("json", [data, ])
      return product_data
  </code></pre>
  
  <p>My urls.py</p>
  
  <pre><code>urlpatterns = [
  url(r'^get_pattern(?P&lt;product_id&gt;[0-9]+)/$', views.get_pattern, name='get_pattern'),
  </code></pre>
  
  <p>]</p>
  
  <p>I've tried everything. But when you go /get_pattern1 it returns:</p>
  
  <pre><code>Request Method: GET
  Request URL:    http://xxxxxxx:8000/xxxx/get_pattern1/
  Django Version: 1.8.3
  Exception Type: AttributeError
  Exception Value:    
  'unicode' object has no attribute 'get'
  Exception Location: /home/xxxx/local/lib/python2.7/site-    packages/django/middleware/clickjacking.py in process_response, line 31
  </code></pre>