Relative Content

Tag Archive for javascriptpythonflaskbackend

I’m getting “jinja2.exceptions.TemplateSyntaxError: unexpected char ‘$’ at 3607” error while trying to render html using js and data from python

I’m trying to use data retrieved by my python get_data() api to create dynamic urls. The data is a dictionary which states whether or not a user owns a specific course. If they own the course (Ex. ‘ownsJava’ : True), then the button called ‘Learn’ will go to that course, if they dont own it (Ex. ‘ownsJava’ : False), then the button will be called ‘Purchase’ and will redirect to the shopping cart. However, to do this I need to include javascript variables into {{ url_for() }} so it will work properly, but I keep on getting this error: jinja2.exceptions.TemplateSyntaxError: unexpected char ‘$’ at 3607 at .