title: TypeError: int() argument must be a string, a bytes-like object or a number, not 'dict' when creating a Token in Django
body: <p>I facing issues in authentication. I am trying to create a Token but getting the error "<em>int() argument must be a string, a bytes-like object or a number, not 'dict'</em>". Below is a snapshot of my code. </p>
  
  <pre><code>*Type "help", "copyright", "credits" or "license" for more information.
  (InteractiveConsole)
  &gt;&gt;&gt; from rest_framework.authtoken.models import Token
  &gt;&gt;&gt; Token.objects.get_or_create(user={'password': '123456', 'username': 'username'})
  Traceback (most recent call last):
    File "&lt;console&gt;", line 1, in &lt;module&gt;
    File "/home/.virtualenvs/venv/lib/python3.4/site-packages/django/db/models/manager.py", line 127, in manager_method
      return getattr(self.get_queryset(), name)(*args, **kwargs)
    File "/home/.virtualenvs/venv/lib/python3.4/site-packages/django/db/models/query.py", line 405, in get_or_create
      return self.get(**lookup), False
    File "/home/.virtualenvs/venv/lib/python3.4/site-packages/django/db/models/query.py", line 325, in get
      clone = self.filter(*args, **kwargs)
    File "/home/.virtualenvs/venv/lib/python3.4/site-packages/django/db/models/query.py", line 679, in filter
      return self._filter_or_exclude(False, *args, **kwargs)
    File "/home/.virtualenvs/venv/lib/python3.4/site-packages/django/db/models/query.py", line 697, in _filter_or_exclude
      clone.query.add_q(Q(*args, **kwargs))
    File "/home/.virtualenvs/venv/lib/python3.4/site-packages/django/db/models/sql/query.py", line 1309, in add_q
      clause, require_inner = self._add_q(where_part, self.used_aliases)
    File "/home/.virtualenvs/venv/lib/python3.4/site-packages/django/db/models/sql/query.py", line 1337, in _add_q
      allow_joins=allow_joins, split_subq=split_subq,
    File "/home/.virtualenvs/venv/lib/python3.4/site-packages/django/db/models/sql/query.py", line 1199, in build_filter
      lookups, value)
    File "/home/.virtualenvs/venv/lib/python3.4/site-packages/django/db/models/fields/related.py", line 1756, in get_lookup_constraint
      lookup_class(target.get_col(alias, source), val), AND)
    File "/home/.virtualenvs/venv/lib/python3.4/site-packages/django/db/models/lookups.py", line 101, in __init__
      self.rhs = self.get_prep_lookup()
    File "/home/.virtualenvs/venv/lib/python3.4/site-packages/django/db/models/lookups.py", line 139, in get_prep_lookup
      return self.lhs.output_field.get_prep_lookup(self.lookup_name, self.rhs)
    File "/home/.virtualenvs/venv/lib/python3.4/site-packages/django/db/models/fields/__init__.py", line 727, in get_prep_lookup
      return self.get_prep_value(value)
    File "/home/.virtualenvs/venv/lib/python3.4/site-packages/django/db/models/fields/__init__.py", line 985, in get_prep_value
      return int(value)
  TypeError: int() argument must be a string, a bytes-like object or a number, not 'dict'*
  </code></pre>
  
  <p>Tried my best to solve this without asking. Any help would be appreciated.</p>
  
  <p>Thanks in advance.</p>