Skip to content
#

ASGI

ASGI (Asynchronous Server Gateway Interface) is a spiritual successor to WSGI, intended to provide a standard interface between async-capable Python web servers, frameworks, and applications.

Here are 208 public repositories matching this topic...

mbdnk
mbdnk commented Nov 13, 2021

Hi!
How can I set response headers if the context object does not contain the response key? I need to set a httpOnly cookie when a user authenticates in the system. For db injection I used Extension.

def authenticate_user(username: str, password: str, info: Info) -> AuthenticateResponse:
    db = info.context['db']
    ...
    info.context["response"].set_cookie(key="token", value
dantownsend
dantownsend commented Nov 12, 2021

It would be nice if there was a new clause which can be added to queries called callback.

For example:

def callback_handler(success, value):
    if success:
        print(f'The query was successful and returned {value}')
    else:
        print("The query failed")

Band.select().callback(callback_handler).run_sync()

The callback could be a function or coroutine, wh