Config
Flask Application Configuration
Configures Flask application with reverse proxy support and authentication settings.
Attributes:
Name | Type | Description |
---|---|---|
app |
Flask
|
Main Flask application instance |
login |
LoginManager
|
Flask-Login manager instance |
Warning
Should not be moved or links to the htmls may break
ReverseProxied
WSGI middleware for handling reverse proxy headers and URL rewriting.
This class modifies the WSGI environment to support running the application behind a reverse proxy, handling script names, URL schemes, and server names.
Attributes:
Name | Type | Description |
---|---|---|
app |
Flask
|
The Flask application instance to wrap |
script_name |
str or None
|
Optional URL prefix for the application |
scheme |
str or None
|
Optional URL scheme (http/https) |
server |
str or None
|
Optional server name |
Methods:
Name | Description |
---|---|
__call__ |
Process the WSGI environment and handle reverse proxy headers |
Source code in apps/annotator/code/config.py
27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 |
|
__call__(environ, start_response)
Process WSGI environment for reverse proxy support.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
environ
|
dict
|
WSGI environment dictionary |
required |
start_response
|
callable
|
WSGI start_response callable |
required |
Returns:
Type | Description |
---|---|
callable
|
Result of calling the wrapped WSGI application |
Source code in apps/annotator/code/config.py
71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 |
|
__init__(app, script_name=None, scheme=None, server=None)
Initialize the reverse proxy middleware.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
app
|
Flask
|
Flask application instance |
required |
script_name
|
str
|
URL prefix for the application |
None
|
scheme
|
str
|
URL scheme (http/https) |
None
|
server
|
str
|
Server name |
None
|
Source code in apps/annotator/code/config.py
51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 |
|