:py:mod:`main` ============== .. py:module:: main Module Contents --------------- Functions ~~~~~~~~~ .. autoapisummary:: main.on_startup main.login_for_access_token main.register main.get_current_user Attributes ~~~~~~~~~~ .. autoapisummary:: main.app .. py:data:: app .. py:function:: on_startup() Called on startup, creates the database tables if they do not exist .. py:function:: login_for_access_token(form_data = Depends(), session = Depends(get_session)) :async: Reads data from the login form and returns a token if the user is valid :param form_data: data sent by the client :param session: database session from dependencies :return: token .. py:function:: register(user, session = Depends(get_session)) Registers a new user :param user: user to add to the database :param session: database session from dependencies :return: user .. py:function:: get_current_user(user = Depends(get_current_active_user)) Returns the current user :param user: active user from dependencies :return: user