title: Flask + asyncio
body: <p>My goal is to upgrade the application from python2 to python3. The application uses the following packages: flask, flask-admin, gevent (coroutine), socketio.
  Flask was decided to leave, and the rest of the packages to be replaced. There have been several attempts to replace the packages:</p>
  
  <ol>
  <li>Tornado + SockJS: a lot of extra code because of the lack of SockJS
  channels</li>
  <li><a href="https://github.com/Hardtack/Flask-aiohttp" rel="nofollow">Flask-aiohttp</a>: during authorization,
  request.form['username'] throws an error:</li>
  </ol>
  
  <p>Traceback (most recent call last):</p>
  
  <pre><code> File "/home/user/.env/rbaio34/lib/python3.4/site-packages/flask/app.py", line 1817, in wsgi_app
  response = self.full_dispatch_request()
  File "/home/user/.env/rbaio34/lib/python3.4/site-packages/flask/app.py", line 1477, in full_dispatch_request
  rv = self.handle_user_exception(e)
  File "/home/user/.env/rbaio34/lib/python3.4/site-packages/flask/app.py",line 1381, in handle_user_exception reraise(exc_type, exc_value, tb)
  File "/home/user/.env/rbaio34/lib/python3.4/site-packages/flask/_compat.py",line 33, in reraise raise value
  File "/home/user/.env/rbaio34/lib/python3.4/site-packages/flask/app.py",line 1475, in full_dispatch_request
  rv = self.dispatch_request()
  File "/home/user/.env/rbaio34/lib/python3.4/site-packages/flask/app.py", line 1461, in dispatch_request return self.view_functions[rule.endpoint](**req.view_args)
   File "/home/user/workspace/aiolina/aiolina.py", line 33, in login username = request.form['username']
  File "/home/user/.env/rbaio34/lib/python3.4/site-packages/werkzeug/local.py", line 338, in __getattr__
  return getattr(self._get_current_object(), name)
  File "/home/user/.env/rbaio34/lib/python3.4/site-packages/werkzeug/utils.py", line 71, in __get__
  value = self.func(obj)
  File "/home/user/.env/rbaio34/lib/python3.4/site-packages/werkzeug/wrappers.py", line 488, in form
  self._load_form_data()
  File "/home/user/.env/rbaio34/lib/python3.4/site-packages/flask/wrappers.py", line 165, in _load_form_data
  RequestBase._load_form_data(self)
  File "/home/user/.env/rbaio34/lib/python3.4/site-packages/werkzeug/wrappers.py", line 360, in _load_form_data
  mimetype, content_length, options)
  File "/home/user/.env/rbaio34/lib/python3.4/site-packages/werkzeug/formparser.py", line 193, in parse
  content_length, options)
  File "/home/user/.env/rbaio34/lib/python3.4/site-packages/werkzeug/formparser.py", line 103, in wrapper
  exhaust()
  File "/home/user/.env/rbaio34/lib/python3.4/site-packages/werkzeug/wsgi.py", line 977, in exhaust
  self.read(chunk)
  File "/home/user/.env/rbaio34/lib/python3.4/site-packages/werkzeug/wsgi.py", line 994, in read
  if to_read and len(read) != to_read:TypeError: object of type 'generator' has no len()
  </code></pre>
  
  <p>So, what can be done to Flask-aiohttp work? Or what packages use instead?</p>