title: Django Python str() argument 2 must be str, not int
body: <p>I have a 12x12 dictionary with values, which are 0 for all.</p>
  
  <pre><code>matchfield = {}
      for i in range(12):
          for j in range(12):
              matchfield[str((i, j))] = 0
  </code></pre>
  
  <p>I want to set some values to 1 with the following snippet (it checks whether the surrounding fields are free):</p>
  
  <pre><code>length = 4
  m = randint(1, 10-length)
  n = randint(1, 10)
  for x in range(m-1, m+length+1):
      for y in range(n-1, n+1):
          if not matchfield[str((x, y))]:
              for k in range(length):
                  matchfield[str((m+k, n))] = 1
  </code></pre>
  
  <p>if I test this in python console, all works and the 4 selected values are set to 1, but in my Django view function I got an TypeError on the following line:</p>
  
  <h2>    matchfield[str((m+k, n))] = 1</h2>
  
  <pre><code>Environment:
  
  
  Request Method: GET
  Request URL: https://www.maik-kusmat.de/schiffeversenken/start/
  
  Django Version: 1.11.5
  Python Version: 3.5.3
  Installed Applications:
  ['django.contrib.admin',
   'django.contrib.auth',
   'django.contrib.contenttypes',
   'django.contrib.sessions',
   'django.contrib.messages',
   'django.contrib.staticfiles',
   'django.contrib.sites',
   'django.contrib.flatpages',
   'accounts',
   'home',
   'contact',
   'kopfrechnen',
   'braces',
   'ckeditor',
   'ckeditor_uploader',
   'battleship',
   'hangman']
  Installed Middleware:
  ['django.middleware.security.SecurityMiddleware',
   'django.contrib.sessions.middleware.SessionMiddleware',
   'django.middleware.common.CommonMiddleware',
   'django.middleware.csrf.CsrfViewMiddleware',
   'django.contrib.auth.middleware.AuthenticationMiddleware',
   'django.contrib.messages.middleware.MessageMiddleware',
   'django.middleware.clickjacking.XFrameOptionsMiddleware',
   'django.middleware.locale.LocaleMiddleware',
   'django.contrib.flatpages.middleware.FlatpageFallbackMiddleware']
  
  
  
  Traceback:
  
  File "/home/pi/Dev/mkenergy/lib/python3.5/site-packages/django/core/handlers/exception.py" in inner
    41.             response = get_response(request)
  
  File "/home/pi/Dev/mkenergy/lib/python3.5/site-packages/django/core/handlers/base.py" in _get_response
    187.                 response = self.process_exception_by_middleware(e, request)
  
  File "/home/pi/Dev/mkenergy/lib/python3.5/site-packages/django/core/handlers/base.py" in _get_response
    185.                 response = wrapped_callback(request, *callback_args, **callback_kwargs)
  
  File "/home/pi/Dev/mkenergy/lib/python3.5/site-packages/django/contrib/auth/decorators.py" in _wrapped_view
    23.                 return view_func(request, *args, **kwargs)
  
  File "/home/pi/Dev/mkenergy/src/battleship/views.py" in battleship_start
    36.                                 matchfield[str((m+k, n))] = 1
  
  Exception Type: TypeError at /schiffeversenken/start/
  Exception Value: str() argument 2 must be str, not int
  </code></pre>
  
  <p>did I miss something? I do not understand the error</p>