Coverage for conf/settings/misc.py: 100%

9 statements  

« prev     ^ index     » next       coverage.py v7.15.2, created at 2026-10-07 06:14 +0000

1"""Settings very specific to Openverse, used inside the API app.""" 

2 

3from decouple import config 

4 

5 

6SHOW_COLLECTION_DOCS = config("SHOW_COLLECTION_DOCS", cast=bool, default=True) 

7 

8FILTER_DEAD_LINKS_BY_DEFAULT = config( 

9 "FILTER_DEAD_LINKS_BY_DEFAULT", cast=bool, default=True 

10) 

11 

12ENABLE_FILTERED_INDEX_QUERIES = config( 

13 "ENABLE_FILTERED_INDEX_QUERIES", cast=bool, default=False 

14) 

15 

16# Log full Elasticsearch response 

17VERBOSE_ES_RESPONSE = config("DEBUG_SCORES", default=False, cast=bool) 

18 

19# Whether to boost results by authority and popularity 

20USE_RANK_FEATURES = config("USE_RANK_FEATURES", default=True, cast=bool) 

21 

22# The scheme to use for the hyperlinks in the API responses 

23API_LINK_SCHEME = config("API_LINK_SCHEME", default=None) 

24 

25# The version of the API. We follow the semantic version specification. 

26API_VERSION = config("SEMANTIC_VERSION", default="Version not specified") 

27 

28OUTBOUND_USER_AGENT_TEMPLATE = config( 

29 "OUTBOUND_USER_AGENT_TEMPLATE", 

30 default=f"Openverse{{purpose}}/{API_VERSION} (https://wordpress.org/openverse)", 

31)