0

I notice that Django can't get to the elements from context dictionary with have extra symbols like '^,=', is there anyway to solve this?

    raise TemplateSyntaxError("Could not parse the remainder: '%s' "
django.template.exceptions.TemplateSyntaxError: Could not parse the remainder: '^SPX' from 'price.^SPX'
{{ price.^SPX }}
def home(request):

    tk_stocks=["^IXIC","^SPX","^DJI"]
    yahoo_financials = YahooFinancials(tk_stocks)
    p_change=yahoo_financials.get_current_percent_change()
    change=yahoo_financials.get_current_change()
    price=yahoo_financials.get_current_price()

    context={
        "p_change":p_change,
        "change":change,
        "price":price
    }

    print(price)
    return render(request, 'home.html', context)
Marcixen
  • 31
  • 3

0 Answers0