search.config module

Flask configuration.

Docstrings are from the Flask configuration documentation.

search.config.APPLICATION_ROOT = '/'

If the application does not occupy a whole domain or subdomain this can be set to the path where the application is configured to live. This is for session cookie as path value. If domains are used, this should be None.

search.config.DEBUG = False

enable/disable debug mode

search.config.ELASTICSEARCH_VERIFY = 'true'

Indicates whether SSL certificate verification for ES should be enforced.

search.config.EXPLAIN_TEMPLATE_LOADING = False

If this is enabled then every attempt to load a template will write an info message to the logger explaining the attempts to locate the template. This can be useful to figure out why templates cannot be found or wrong templates appear to be loaded.

search.config.JSONIFY_MIMETYPE = 'application/json'

MIME type used for jsonify responses.

search.config.JSONIFY_PRETTYPRINT_REGULAR = True

If this is set to True (the default) jsonify responses will be pretty printed if they are not requested by an XMLHttpRequest object (controlled by the X-Requested-With header).

search.config.JSON_AS_ASCII = False

By default Flask serialize object to ascii-encoded JSON. If this is set to False Flask will not encode to ASCII and output strings as-is and return unicode strings. jsonify will automatically encode it in utf-8 then for transport for instance.

search.config.JSON_SORT_KEYS = True

By default Flask will serialize JSON objects in a way that the keys are ordered. This is done in order to ensure that independent of the hash seed of the dictionary the return value will be consistent to not trash external HTTP caches. You can override the default behavior by changing this variable. This is not recommended but might give you a performance improvement on the cost of cacheability.

search.config.KINESIS_ENDPOINT = None

Can be used to set an alternate endpoint, e.g. for testing.

search.config.KINESIS_SLEEP = '0.1'

Amount of time to wait before moving on to the next record.

search.config.KINESIS_STREAM = 'MetadataIsAvailable'

Name of the stream to which the indexing agent subscribes.

search.config.KINESIS_VERIFY = 'true'

Indicates whether SSL certificate verification should be enforced.

search.config.LOGGER_HANDLER_POLICY = 'debug'

the policy of the default logging handler. The default is ‘always’ which means that the default logging handler is always active. ‘debug’ will only activate logging in debug mode, ‘production’ will only log in production and ‘never’ disables it entirely.

search.config.LOGGER_NAME = 'search'

The name of the logger.

search.config.LOGLEVEL = 40

Log level for search service.

See https://docs.python.org/3/library/logging.html#logging-levels .

search.config.MAX_CONTENT_LENGTH = None

If set to a value in bytes, Flask will reject incoming requests with a content length greater than this by returning a 413 status code.

search.config.METADATA_CACHE_DIR = None

Cache directory for metadata documents.

search.config.METADATA_ENDPOINT = 'https://arxiv.org/'

Location of endpoint(s) for metadata retrieval.

Multiple endpoints may be provided with comma delimitation.

search.config.METADATA_VERIFY_CERT = 'True'

If False, SSL certificate verification will be disabled.

search.config.PREFERRED_URL_SCHEME = 'http'

The URL scheme that should be used for URL generation if no URL scheme is available. This defaults to http.

search.config.PRESERVE_CONTEXT_ON_EXCEPTION = None

By default if the application is in debug mode the request context is not popped on exceptions to enable debuggers to introspect the data. This can be disabled by this key. You can also use this setting to force-enable it for non debug execution which might be useful to debug production applications (but also very risky).

search.config.PROPAGATE_EXCEPTIONS = None

explicitly enable or disable the propagation of exceptions. If not set or explicitly set to None this is implicitly true if either TESTING or DEBUG is true.

search.config.SEND_FILE_MAX_AGE_DEFAULT = 43200

Default cache control max age to use with send_static_file() (the default static file handler) and send_file(), as datetime.timedelta or as seconds. Override this value on a per-file basis using the get_send_file_max_age() hook on Flask or Blueprint, respectively. Defaults to 43200 (12 hours).

search.config.SERVER_NAME = None

the name and port number of the server. Required for subdomain support (e.g.: ‘myapp.dev:5000’) Note that localhost does not support subdomains so setting this to ‘localhost’ does not help. Setting a SERVER_NAME also by default enables URL generation without a request context but with an application context.

search.config.TEMPLATES_AUTO_RELOAD = False

Whether to check for modifications of the template source and reload it automatically. By default the value is None which means that Flask checks original file only in debug mode.

search.config.TESTING = False

enable/disable testing mode

search.config.TRAP_BAD_REQUEST_ERRORS = False

Werkzeug’s internal data structures that deal with request specific data will raise special key errors that are also bad request exceptions. Likewise many operations can implicitly fail with a BadRequest exception for consistency. Since it’s nice for debugging to know why exactly it failed this flag can be used to debug those situations. If this config is set to True you will get a regular traceback instead.

search.config.TRAP_HTTP_EXCEPTIONS = False

If this is set to True Flask will not execute the error handlers of HTTP exceptions but instead treat the exception like any other and bubble it through the exception stack. This is helpful for hairy debugging situations where you have to find out where an HTTP exception is coming from.

search.config.USE_X_SENDFILE = False

Enable/disable x-sendfile