Create working demo (#5)
* Add docs example and update demo source code * Fail with debug * Fix tests * Update sql scripts * Update docs * Add checking for the password * Update documentation with launch/usage example * Launch flake8 instead of pep8 and pyflakes
This commit is contained in:
committed by
Andrew Svetlov
parent
fec22f971c
commit
820dcc8d93
@@ -1,8 +1,11 @@
|
||||
.. _aiohttp-security-example:
|
||||
|
||||
===============================================
|
||||
How to Make a Simple Server With Authorization
|
||||
==============================================
|
||||
===============================================
|
||||
|
||||
|
||||
.. code::python
|
||||
Simple example::
|
||||
|
||||
import asyncio
|
||||
from aiohttp import web
|
||||
@@ -13,7 +16,7 @@ How to Make a Simple Server With Authorization
|
||||
return web.Response(body=text.encode('utf-8'))
|
||||
|
||||
# option 2: auth at a higher level?
|
||||
# set user_id and allowed in the wsgo handler
|
||||
# set user_id and allowed in the wsgi handler
|
||||
@protect('view_user')
|
||||
@asyncio.coroutine
|
||||
def user_handler(request):
|
||||
|
||||
Reference in New Issue
Block a user