Django : TemplateSyntaxError("Не удалось разобрать остаток: '%s' "
Я заметил, что Django не может получить элементы из контекстного словаря с лишними символами вроде '^,=', есть ли способ решить это?
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_tech = YahooFinancials(tk_stocks)
p_change=yahoo_financials_tech.get_current_percent_change()
change=yahoo_financials_tech.get_current_change()
price=yahoo_financials_tech.get_current_price()
context={
"p_change":p_change,
"change":change,
"price":price
}
print(price)
return render(request, 'home.html', context)