I am testing the api from block.io https://block.io/api/simple/python
{
"status" : "success",
"data" : {
"network" : "BTCTEST",
"available_balance" : "0.0",
"pending_received_balance" : "0.0",
"balances" : [
{
"user_id" : 0,
"label" : "default",
"address" : "2NCjjB8iVKu9jnYpNcYKxxRYP9w6eWXZAq4",
"available_balance" : "0.00000000",
"pending_received_balance" : "0.00000000"
}
]
}
}
I would like to display for example only the wallet address of the user in question so that he can make a deposit.
My views.py
from django.shortcuts import render
from block_io import BlockIo
version = 2 # API version
block_io = BlockIo('28a8-ba34-8b81-137d', '1111111', version)
def index(request):
balance = block_io.get_address_balance(labels='shibe1')
context = {'balance': balance}
return render(request, 'home.html', context)
home.html
<h1>Block.io API</h1>
{{ balance }}
<h1>I want display example this data</h1>
<h1>Label: default</h1>
<h1>Available balance: 0.00000000</h1>
<h1>Pending received balance: 0.00000000</h1>
<h1>Address: 2NCjjB8iVKu9jnYpNcYKxxRYP9w6eWXZAq4</h1>
When I do this all the data is displayed but example I only want to address
{'status': 'success', 'data': {'network': 'BTCTEST', 'available_balance': '0.0', 'pending_received_balance': '0.0', 'balances': [{'user_id': 1, 'label': 'shibe1', 'address': '2NADUMWksxJZRKPSNXya8R2LYQY2fGa5mNY', 'available_balance': '0.00000000', 'pending_received_balance': '0.00000000'}]}}
How can I refer only to the data that I want?