Application Web

Command line

mathenjeu.cli.create_https_app (secret_log = None, folder = “.”, max_age = 1209600, cookie_key = None, cookie_name = “mathenjeu”, cookie_domain = “127.0.0.1”, cookie_path = “/”, title = “Web Application MathEnJeu”, short_title = “MathEnJeu”, page_doc = “http://www.xavierdupre.fr/app/mathenjeu/”, secure = False, display = None, games = “simple_french_qcm,simple_french_qcm,0;ml_french_qcm,ml_french_qcm,0”, port = 8868, middles = None, start = False, userpwd = None, debug = False, access_log = “-“, access_log_format = “%(h)s %(r)s %(s)s %(b)s %(D)s”, ca_certs = None, certfile = None, error_log = “-“, keep_alive = 600, keyfile = None, root_path = “”, workers = 1, reload = False, ciphers = “ECDHE+AESGCM”, fLOG = <built-in function print>)

Creates a https web-application with https authentification.

mathenjeu.cli.create_local_app (secret_log = None, folder = “.”, max_age = 1209600, cookie_key = None, cookie_name = “mathenjeu”, cookie_domain = “127.0.0.1”, cookie_path = “/”, title = “Web Application MathEnJeu”, short_title = “MathEnJeu”, page_doc = “http://www.xavierdupre.fr/app/mathenjeu/”, secure = False, display = None, fct_game = None, games = “simple_french_qcm,simple_french_qcm,0;ml_french_qcm,ml_french_qcm,0”, port = 8868, middles = None, start = False, userpwd = None, debug = False, fLOG = <built-in function print>)

Creates a local web-application with very simple authentification.

mathenjeu.cli.create_self_signed_cert (keyfile = “key.pem”, certfile = “cert.pem”, country = “FR”, state = “Paris”, location = “Paris”, organization = “mathenjeu”, cn = “mathenjeu”, organizational_unit_name = None, email = None, size = 4096, days = 365, algo = “sha256”, fLOG = <built-in function print>)

Creates a signed certificate.

Common

mathenjeu.apps.common.AuthentificationAnswers (self, app, login_page = “login.html”, notauth_page = “notauthorized.html”, redirect_logout = “/”, max_age = 1209600, cookie_key = None, cookie_name = “mathenjeu”, cookie_domain = “127.0.0.1”, cookie_path = “/”, secure = False, page_context = None, userpwd = None)

Defines answers for an application with authentification. It stores a cookie with only the user alias. The method authentify_user must be overwritten. The method page_context returns additional information to add before applying any template.

mathenjeu.apps.common.LogApp (self, folder = “.”, secret_log = None, fct_session = None, kwargs)

Defines methods to easily log information for a web application. The function fct_session returns information about the session whatever it is as a dictionary.

Server

mathenjeu.apps.server.ServerHypercorn (self, kwargs)

Implements a server based on hypercorn.

WebApp

mathenjeu.apps.QCMApp (self, secret_log = None, folder = “.”, max_age = 1209600, cookie_key = None, cookie_name = “mathenjeu”, cookie_domain = “127.0.0.1”, cookie_path = “/”, title = “Web Application MathEnJeu”, short_title = “MathEnJeu”, page_doc = “http://www.xavierdupre.fr/app/mathenjeu/”, secure = False, display = None, fct_game = None, games = None, middles = None, debug = False, userpwd = None)

Implements routes for a web application. Module uvicorn does not implement a secured connection. hypercorn is one alternative.