.oO SearXNG Developer Documentation Oo.
|
Functions | |
get_locale () | |
_get_browser_language (req, lang_list) | |
_get_locale_rfc5646 (locale) | |
code_highlighter (codelines, language=None) | |
get_result_template (str theme_name, str template_name) | |
custom_url_for (str endpoint, **values) | |
image_proxify (str url) | |
get_translations () | |
get_enabled_categories (typing.Iterable[str] category_names) | |
get_pretty_url (urllib.parse.ParseResult parsed_url) | |
get_client_settings () | |
render (str template_name, **kwargs) | |
pre_request () | |
add_default_headers (flask.Response response) | |
post_request (flask.Response response) | |
index_error (str output_format, str error_message) | |
index () | |
health () | |
client_token (token=None) | |
rss_xsl () | |
search () | |
about () | |
info (pagename, locale) | |
autocompleter () | |
preferences () | |
image_proxy () | |
engine_descriptions () | |
stats () | |
stats_errors () | |
stats_checker () | |
stats_open_metrics () | |
robots () | |
opensearch () | |
favicon () | |
clear_cookies () | |
config () | |
page_not_found (_e) | |
run () | |
init () | |
None | static_headers (Headers headers, str _path, str _url) |
Variables | |
logger = logger.getChild('webapp') | |
default_theme = settings['ui']['default_theme'] | |
templates_path = settings['ui']['templates_path'] | |
themes = get_themes(templates_path) | |
result_templates = get_result_templates(templates_path) | |
dict | STATS_SORT_PARAMETERS |
app = Flask(__name__, static_folder=None, template_folder=templates_path) | |
trim_blocks | |
lstrip_blocks | |
secret_key | |
babel = Babel(app, locale_selector=get_locale) | |
list | _STATIC_FILES = [] |
methods | |
endpoint | |
view_func | |
wsgi_app | |
root | |
prefix | |
max_age | |
allow_all_origins | |
add_headers_function | |
application = app |
WebApp
|
protected |
Definition at line 166 of file webapp.py.
Referenced by pre_request().
|
protected |
Get locale name for <html lang="..."> Chrom* browsers don't detect the language when there is a subtag (ie a territory). For example "zh-TW" is detected but not "zh-Hant-TW". This function returns a locale without the subtag.
Definition at line 172 of file webapp.py.
Referenced by render().
searx.webapp.about | ( | ) |
Redirect to about page
Definition at line 775 of file webapp.py.
References custom_url_for().
searx.webapp.add_default_headers | ( | flask.Response | response | ) |
Definition at line 508 of file webapp.py.
searx.webapp.autocompleter | ( | ) |
Return autocompleter results
Definition at line 798 of file webapp.py.
searx.webapp.clear_cookies | ( | ) |
searx.webapp.client_token | ( | token = None | ) |
searx.webapp.code_highlighter | ( | codelines, | |
language = None ) |
Definition at line 184 of file webapp.py.
searx.webapp.config | ( | ) |
Return configuration in JSON format.
Definition at line 1260 of file webapp.py.
References searx.get_setting().
searx.webapp.custom_url_for | ( | str | endpoint, |
** | values ) |
Definition at line 241 of file webapp.py.
Referenced by about(), get_client_settings(), and render().
searx.webapp.engine_descriptions | ( | ) |
Definition at line 1081 of file webapp.py.
References get_locale().
searx.webapp.favicon | ( | ) |
Definition at line 1242 of file webapp.py.
searx.webapp.get_client_settings | ( | ) |
Definition at line 345 of file webapp.py.
References custom_url_for(), searx.get_setting(), and get_translations().
Referenced by render().
searx.webapp.get_enabled_categories | ( | typing.Iterable[str] | category_names | ) |
The categories in ``category_names```for which there is no active engine are filtered out and a reduced list is returned.
Definition at line 319 of file webapp.py.
Referenced by render().
searx.webapp.get_locale | ( | ) |
Definition at line 157 of file webapp.py.
Referenced by engine_descriptions().
searx.webapp.get_pretty_url | ( | urllib.parse.ParseResult | parsed_url | ) |
Definition at line 330 of file webapp.py.
searx.webapp.get_result_template | ( | str | theme_name, |
str | template_name ) |
searx.webapp.get_translations | ( | ) |
Definition at line 308 of file webapp.py.
Referenced by get_client_settings().
searx.webapp.health | ( | ) |
searx.webapp.image_proxify | ( | str | url | ) |
Definition at line 282 of file webapp.py.
searx.webapp.image_proxy | ( | ) |
Definition at line 1008 of file webapp.py.
searx.webapp.index | ( | ) |
Render index page.
Definition at line 569 of file webapp.py.
References render().
searx.webapp.index_error | ( | str | output_format, |
str | error_message ) |
Definition at line 539 of file webapp.py.
References render().
Referenced by search().
searx.webapp.info | ( | pagename, | |
locale ) |
Render page of online user documentation
Definition at line 782 of file webapp.py.
References render().
searx.webapp.init | ( | ) |
Definition at line 1363 of file webapp.py.
References searx.get_setting(), searx.plugins.initialize(), and searx.search.initialize().
searx.webapp.opensearch | ( | ) |
Definition at line 1225 of file webapp.py.
References render().
searx.webapp.page_not_found | ( | _e | ) |
searx.webapp.post_request | ( | flask.Response | response | ) |
Definition at line 518 of file webapp.py.
searx.webapp.pre_request | ( | ) |
Definition at line 446 of file webapp.py.
References _get_browser_language().
searx.webapp.preferences | ( | ) |
Render preferences page && save user preferences
Definition at line 847 of file webapp.py.
References searx.get_setting(), and render().
searx.webapp.render | ( | str | template_name, |
** | kwargs ) |
Definition at line 367 of file webapp.py.
References _get_locale_rfc5646(), custom_url_for(), get_client_settings(), get_enabled_categories(), and searx.get_setting().
Referenced by index(), index_error(), info(), opensearch(), page_not_found(), preferences(), search(), and stats().
searx.webapp.robots | ( | ) |
Definition at line 1211 of file webapp.py.
searx.webapp.rss_xsl | ( | ) |
searx.webapp.run | ( | ) |
Runs the application on a local development server. This run method is only called when SearXNG is started via ``__main__``:: python -m searx.webapp Do not use :ref:`run() <flask.Flask.run>` in a production setting. It is not intended to meet security and performance requirements for a production server. It is not recommended to use this function for development with automatic reloading as this is badly supported. Instead you should be using the flask command line script’s run support:: flask --app searx.webapp run --debug --reload --host 127.0.0.1 --port 8888 .. _Flask.run: https://flask.palletsprojects.com/en/stable/api/#flask.Flask.run
Definition at line 1326 of file webapp.py.
References searx.get_setting().
searx.webapp.search | ( | ) |
Search query in q and return results. Supported outputs: html, json, csv, rss.
Definition at line 606 of file webapp.py.
References index_error(), and render().
None searx.webapp.static_headers | ( | Headers | headers, |
str | _path, | ||
str | _url ) |
Definition at line 1386 of file webapp.py.
searx.webapp.stats | ( | ) |
Render engine statistics page.
Definition at line 1107 of file webapp.py.
References render().
searx.webapp.stats_checker | ( | ) |
searx.webapp.stats_errors | ( | ) |
Definition at line 1174 of file webapp.py.
searx.webapp.stats_open_metrics | ( | ) |
Definition at line 1187 of file webapp.py.
searx.webapp.app = Flask(__name__, static_folder=None, template_folder=templates_path) |
searx.webapp.babel = Babel(app, locale_selector=get_locale) |
searx.webapp.default_theme = settings['ui']['default_theme'] |
searx.webapp.result_templates = get_result_templates(templates_path) |
dict searx.webapp.STATS_SORT_PARAMETERS |
searx.webapp.templates_path = settings['ui']['templates_path'] |
searx.webapp.themes = get_themes(templates_path) |