forked from Ponysearch/Ponysearch
[mod][fix] using base_url instead of hostname in settings.py
This commit is contained in:
parent
ff0bbd3566
commit
32512856b4
2 changed files with 3 additions and 3 deletions
|
@ -13,4 +13,4 @@ blacklist = [] # search engine blacklist
|
||||||
|
|
||||||
categories = {} # custom search engine categories
|
categories = {} # custom search engine categories
|
||||||
|
|
||||||
hostname = None # domain name or None - if you want to rewrite the default HTTP host
|
base_url = None # "https://your.domain.tld/" or None (to use request parameters)
|
||||||
|
|
|
@ -165,8 +165,8 @@ def opensearch():
|
||||||
method = 'get'
|
method = 'get'
|
||||||
if request.is_secure:
|
if request.is_secure:
|
||||||
scheme = 'https'
|
scheme = 'https'
|
||||||
if settings.hostname:
|
if settings.base_url:
|
||||||
hostname = '{0}://{1}/'.format(scheme,settings.hostname)
|
hostname = settings.base_url
|
||||||
else:
|
else:
|
||||||
hostname = url_for('index', _external=True, _scheme=scheme)
|
hostname = url_for('index', _external=True, _scheme=scheme)
|
||||||
ret = opensearch_xml.format(method=method, host=hostname)
|
ret = opensearch_xml.format(method=method, host=hostname)
|
||||||
|
|
Loading…
Reference in a new issue