Jinja2.exceptions.TemplateSyntaxError: Expected Token 'end Of Print Statement', Got 'posted'
I'm new to programming and recently a friend of mine gave me a project to work on in order to get myself familiar with the programming environment and language (python in this part
Solution 1:
The line <p>By {{ post.author }} on {{ post.date posted }}</p>
is the issue here
Replace it with <p>By {{ post.author }} on {{ post.date_posted }}</p>
post.date_posted
is a variable and should be same as the one in your models, And spaces between them are obviously syntax errors(typos)
Baca Juga
- How Can I Automate The Form Filling Process For A User On My Webpage With Voice Via Their Microphone?
- What Is The Best Way To Implement A Forced Page Refresh Using Flask?
- In A Flask Function Which Returns `send_file`, The Code Doesn't Appear To Run On Subsequent Requests, Yet The File Still Downloads. Why?
Solution 2:
You have to do <p>By {{ post['author'] }} on {{ post['date posted'] }}
to make it work. it is a dict. So you have to get the values with indicies instead of calls.
Post a Comment for "Jinja2.exceptions.TemplateSyntaxError: Expected Token 'end Of Print Statement', Got 'posted'"