maeser.admin_portal package#
This is the admin_portal subpackage for the Maeser package.
The run_admin_portal() function provides access to the Admin Portal, a web applet that is useful for automatically vectorizing data and creating courses for use with other Maeser handlers, such as maeser.discord_handler.
In order to use this subpackage, the dependencies in maeser[admin_portal] must be installed (pip install maeser[admin_portal]).
- maeser.admin_portal.run_admin_portal(username: str = 'adam', password: str = 'ajosiahs', secret_key: str | None = None, host: str | None = None, port: int | None = None, debug: bool | None = None, load_dotenv: bool = True, **options)[source]#
Runs the admin portal flask application.
Allows a username, password, and secret key to be declared as well as all standard Flask.run parameters. See the Flask documentation for more information on parameters and options.
In production, username, password, and secret_key should always be assigned.
- Parameters:
username (str, optional) – The username for logging in to the admin portal. Defaults to “adam”.
password (str, optional) – The password for logging in to the admin portal. Defaults to “ajosiahs”.
secret_key (str, optional) – The secret key to assign to the application. Creates a random key if none is provided.
host (str | None, optional) – The web server hostname.
port (int | None, optional) – The web server port.
debug (bool | None, optional) – If True, enables debug mode.
load_dotenv (bool, optional) – Loads .env and .flaskenv files to initialize environment variables. Defaults to True.
options – Werkzeug server options. For more information, see
werkzeug.serving.run_simple
.