module apps.staticapp.staticsite
¶
Short summary¶
module mathenjeu.apps.staticapp.staticsite
Starts an application.
Classes¶
class |
truncated documentation |
---|---|
Implements routes for a web application which serves static files protected with a password. See Which server to server starlette application?. … |
Methods¶
method |
truncated documentation |
---|---|
Cleans up. |
|
This route does not return anything interesting except a blank page, but it logs |
|
Defines the main page. |
|
Returns an HTTP 404 page. |
|
An example error. |
|
Returns the page context before applying any template. |
|
Returns an HTTP 500 page. |
|
Startups. |
|
Returns an answer for somebody looking to access the questions without being authentified. |
Documentation¶
Starts an application.
- class mathenjeu.apps.staticapp.staticsite.StaticApp(secret_log=None, folder='.', max_age=1209600, cookie_key=None, cookie_name='mathenjeu_static', cookie_domain='127.0.0.1', cookie_path='/', content=None, title='MathEnJeu - Static Files', short_title='MEJ', page_doc='http://www.xavierdupre.fr/app/mathenjeu/helpsphinx/', secure=False, middles=None, debug=False, userpwd=None)¶
Bases :
mathenjeu.apps.common.log_app.LogApp
,mathenjeu.apps.common.auth_app.AuthentificationAnswers
Implements routes for a web application which serves static files protected with a password. See Which server to server starlette application?. The application allows anybody to connect to the website assuming the know the password.
- 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 servertitle – title
short_title – short application title
middles – middles ware, list of couple
[(class, **kwargs)]
where kwargs are the parameter constructoruserpwd – users are authentified with any alias but a common password
debug – display debug information (starlette option)
- __init__(secret_log=None, folder='.', max_age=1209600, cookie_key=None, cookie_name='mathenjeu_static', cookie_domain='127.0.0.1', cookie_path='/', content=None, title='MathEnJeu - Static Files', short_title='MEJ', page_doc='http://www.xavierdupre.fr/app/mathenjeu/helpsphinx/', secure=False, middles=None, debug=False, userpwd=None)¶
- 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 servertitle – title
short_title – short application title
middles – middles ware, list of couple
[(class, **kwargs)]
where kwargs are the parameter constructoruserpwd – users are authentified with any alias but a common password
debug – display debug information (starlette option)
- cleanup()¶
Cleans up.
- async event(request)¶
This route does not return anything interesting except a blank page, but it logs
- async main(request)¶
Defines the main page.
- async on_error(request)¶
An example error.
- page_context(**kwargs)¶
Returns the page context before applying any template.
- Paramètres
kwargs – arguments
- Renvoie
parameters
- startup()¶
Startups.
- unlogged_response(request, session)¶
Returns an answer for somebody looking to access the questions without being authentified.