register simple_tag def currency acronym response requests get setting

1
2
3
4
5
6
@register.simple_tag
def currency(acronym):
response = requests.get(settings.CBR_API_URL)
day_result = response.json()
all_valute = day_result['Valute']
return all_valute[acronym]['Value']