title: Unsure how to resolve this Bottle error (Python)
body: <p>Here are my imports:</p>
  
  <pre><code>from bottle import request, route, run, template, static_file, redirect
  from urllib2 import urlopen, URLError, Request
  from pymongo import MongoClient
  from config.development import config
  import json
  </code></pre>
  
  <p>And here is the offending line (and another line that I think may be causing an issue):</p>
  
  <pre><code>game_id = request.forms.get('game_id')
  request = Request(config['singlegame_url'].replace('$GAMEID', game_id))
  </code></pre>
  
  <p>The error I'm getting is:</p>
  
  <pre><code>UnboundLocalError("local variable 'request' referenced before assignment",)
  
  Traceback (most recent call last):
    File "/usr/local/lib/python2.7/site-packages/bottle.py", line 862, in _handle
      return route.call(**args)
    File "/usr/local/lib/python2.7/site-packages/bottle.py", line 1732, in wrapper
      rv = callback(*a, **ka)
    File "app.py", line 23, in add
      game_id = request.forms.get('game_id')
  UnboundLocalError: local variable 'request' referenced before assignment
  </code></pre>
  
  <p>My first thought was that the two <code>request</code> modules were causing issues, but I couldn't get the error to go away by messing around with the imports and importing stuff <code>as</code> another name.</p>