module cli.static_app

Short summary

module mathenjeu.cli.static_app

Starts an app locally to test it.

source on GitHub

Functions

function

truncated documentation

create_static_https_app

Creates a https web-application with https authentification.

create_static_local_app

Creates a local web-application with very simple authentification.

Documentation

Starts an app locally to test it.

source on GitHub

mathenjeu.cli.static_app.create_static_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/helpsphinx/', secure=False, port=8868, middles=None, start=False, userpwd=None, debug=False, content=None, 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>)[source]

Creates a https web-application with https authentification.

Paramètres
  • secret_log – to encrypt log (None to ignore)

  • folder – folder where to write the logs (None to disable the logging)

  • max_age – cookie’s duration in seconds

  • cookie_key – to encrypt information in the cookie (cannot be None)

  • cookie_name – name of the session cookie

  • cookie_domain – cookie is valid for this path only, also defines the domain of the web app (its url)

  • cookie_path – path of the cookie once storeds

  • secure – use secured connection for cookies

  • title – title

  • short_title – short application title

  • page_doc – page documentation (default is “http://www.xavierdupre.fr/app/mathenjeu/helpsphinx”)

  • port – port to deploy the application

  • middles – middles ware, list of couple [(class, **kwargs)] where kwargs are the parameter constructor

  • start – starts the application with uvicorn

  • userpwd – users are authentified with any alias but a common password

  • debug – display debug information (starlette option)

  • content – list tuple route, folder to server or a string route1,folder1;route2,folder2;...

  • access_log – The target location for the access log, use - for stdout.

  • access_log_format – The log format for the access log, see help docs, see Logging.

  • ca_certs – Path to the SSL CA certificate file.

  • certfile – Path to the SSL certificate file.

  • ciphers – Ciphers to use for the SSL setup, the default can be found at config.py

  • error_log – The target location for the error log, use - for stderr.

  • keep_alive – Seconds to keep inactive connections alive for.

  • keyfile – Path to the SSL key file

  • root_path – The setting for the ASGI root_path variable.

  • workers – The number of workers to spawn and use.

  • reload – Enable automatic reloads on code changes.

  • fLOG – logging function

Renvoie

StaticApp

Creates a https static web-application with authentification

The command line runs a web application meant to be local as there is not https involved. It servers static content. The web app relies on starlette, the server relies on hypercorn. Example:

python -m mathenjeu local_https

With that application, every user can login with a unique password abc.

<<<

python -m mathenjeu local_https --help

>>>

Command not found: 'local_https'.

Available commands:

    create_self_signed_cert   Creates a signed certificate.
    qcm_https                 Creates a https web-application with https authentification.
    qcm_local                 Creates a local web-application with very simple authentification.
    static_https              Creates a https web-application with https authentification.
    static_local              Creates a local web-application with very simple authentification.

source on GitHub

mathenjeu.cli.static_app.create_static_local_app(secret_log=None, folder='.', max_age=1209600, cookie_key=None, cookie_name='mathenjeu', cookie_domain='127.0.0.1', cookie_path='/', content=None, title='Web Application MathEnJeu', short_title='MathEnJeu', page_doc='http://www.xavierdupre.fr/app/mathenjeu/helpsphinx/', secure=False, port=8868, middles=None, start=False, userpwd=None, debug=False, fLOG=<built-in function print>)[source]

Creates a local web-application with very simple authentification.

Paramètres
  • secret_log – to encrypt log (None to ignore)

  • folder – folder where to write the logs (None to disable the logging)

  • max_age – cookie’s duration in seconds

  • cookie_key – to encrypt information in the cookie (cannot be None)

  • cookie_name – name of the session cookie

  • cookie_domain – cookie is valid for this path only, also defines the domain of the web app (its url)

  • cookie_path – path of the cookie once storeds

  • secure – use secured connection for cookies

  • content – list tuple route, folder to server or a string route1,folder1;route2,folder2;...

  • title – title

  • short_title – short application title

  • page_doc – page documentation (default is :epkg:`mathenjeu`)

  • port – port to deploy the application

  • middles – middles ware, list of couple [(class, **kwargs)] where kwargs are the parameter constructor

  • start – starts the application with uvicorn

  • userpwd – users are authentified with any alias but a common password

  • debug – display debug information (starlette option)

  • fLOG – logging function

Renvoie

StaticApp

Creates a local web-application with very simple authentification

The command line runs a web application meant to be local as there is not https involved. It serves static content. The web app relies on starlette, the server relies on uvicorn. Example of use:

python -m mathenjeu local_static --cookie_key=dummypwd --start=1 --port=8889 --userpwd=abc --content=display_name,local_folder

With that application, every user can login with a unique password abc.

<<<

python -m mathenjeu local_static --help

>>>

Command not found: 'local_static'.

Available commands:

    create_self_signed_cert   Creates a signed certificate.
    qcm_https                 Creates a https web-application with https authentification.
    qcm_local                 Creates a local web-application with very simple authentification.
    static_https              Creates a https web-application with https authentification.
    static_local              Creates a local web-application with very simple authentification.

source on GitHub