def ticker(): last_price = Price.last() if last_price is not None: return jsonify(btcnok={ 'buy': str(round(last_price.btcnok(rate=settings['BUY_RATE']), 2)), 'sell': str(round(last_price.btcnok(rate=settings['SELL_RATE']), 2)), }) else: abort(503)
def ticker(): last_price = Price.last() if last_price is not None: return jsonify( btcnok={ 'buy': str(round(last_price.btcnok(rate=settings['BUY_RATE']), 2)), 'sell': str(round(last_price.btcnok(rate=settings['SELL_RATE']), 2)), }) else: abort(503)
def home(): now = settings['TIMEZONE'].fromutc(datetime.utcnow()) last_price = Price.last() if last_price is not None: current_price = { 'buy': last_price.btcnok(rate=settings['BUY_RATE']), 'sell': last_price.btcnok(rate=settings['SELL_RATE']), } else: current_price = None context = { 'current_price': current_price, 'price_history': json.dumps(get_price_history(app)), 'now': now, } return render_template('home.html', **context)
def home(): now = settings['TIMEZONE'].fromutc(datetime.utcnow()) last_price = Price.last() if last_price is not None: current_price = { 'buy': last_price.btcnok(rate=settings['BUY_RATE']), 'sell': last_price.btcnok(rate=settings['SELL_RATE']), } else: current_price = None context = { 'current_price': current_price, 'price_history': json.dumps(get_price_history(app)), 'now': now, } return render_template('home.html', **context)