diff --git a/.env-sample b/.env-sample index c6c95de9..e928c6a4 100644 --- a/.env-sample +++ b/.env-sample @@ -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' \ No newline at end of file +ESCROW_USERNAME = 'admin' diff --git a/api/views.py b/api/views.py index 32e76a1c..713d6fb0 100644 --- a/api/views.py +++ b/api/views.py @@ -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 diff --git a/robosats/settings.py b/robosats/settings.py index eecf89a4..fb4f49f2 100644 --- a/robosats/settings.py +++ b/robosats/settings.py @@ -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