Add allowed local host alias

This commit is contained in:
rs 2022-02-12 23:09:13 +00:00
parent 8fcad56e15
commit 04e097536e
3 changed files with 4 additions and 3 deletions

View File

@ -18,6 +18,7 @@ MARKET_PRICE_APIS = https://blockchain.info/ticker, https://api.yadio.io/exrates
# Host e.g. robosats.com
HOST_NAME = ''
LOCAL_ALIAS = 'e.g:my_garbage_server'
# SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY = 'django-insecure-6^&6uw$b5^en%(cu2kc7_o)(mgpazx#j_znwlym0vxfamn2uo-'
@ -67,4 +68,4 @@ PROPORTIONAL_ROUTING_FEE_LIMIT = 0.0002
MIN_FLAT_ROUTING_FEE_LIMIT = 10
# Username for HTLCs escrows
ESCROW_USERNAME = 'admin'
ESCROW_USERNAME = 'admin'

View File

@ -508,7 +508,7 @@ class InfoView(ListAPIView):
for tick in queryset:
weighted_premiums.append(tick.premium*tick.volume)
volumes.append(tick.volume)
total_volume = sum(volumes)
# Avg_premium is the weighted average of the premiums by volume
avg_premium = sum(weighted_premiums) / total_volume

View File

@ -36,7 +36,7 @@ if os.environ.get('DEVELOPMENT'):
AVATAR_ROOT = STATIC_ROOT + 'assets/avatars/'
ALLOWED_HOSTS = [config('HOST_NAME'),'127.0.0.1']
ALLOWED_HOSTS = [config('HOST_NAME'),config('LOCAL_ALIAS'),'127.0.0.1']
# Application definition