Questions tagged [jinja]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0 votes
0 answers
17 views

PSET9 Finance: USD function returns error only when both rendering Index AND after BUY completes a 'purchase'

"unsupported format string passed to Undefined.format"--I know this happens because the non-numerical value is passed into the USD function, but I can't seem to spot the culprit. As ...
user avatar
0 votes
2 answers
33 views

Is there a way in jinja to display a block in a specific page?

I have a layout.html page with a <footer> that I want to display in almost all pages using {% extends "layout.html %}. Only in the user profile page the footer will be different. How can I ...
user avatar
0 votes
1 answer
319 views

Flask Filter Search/List in Python

I created a country list on the python search page section, the data is sent to the Html table with jinja syntax “ The Html table also has a JavaScript function it functions correctly no help with ...
user avatar
  • 47
0 votes
1 answer
161 views

jinja code not working inside html file

I am using flask for the first time and jinja code is being displayed on the webpage. this is my html file: <!DOCTYPE html> <html lang="en"> <head> ...
user avatar
0 votes
0 answers
250 views

Pset 9 finance-Problems for type= number output on the webpage

I am working on a CS50 task called "finance". The problem is that I get an error when I want to check the integer value of the share amount and put it on a separate template for checking my ...
user avatar
0 votes
1 answer
1k views

pset9 Finance "jinja2.exceptions.TemplateSyntaxError: expected name or number" error

In my index function, every time I try "flask run" it outputs that error (jinja2.exceptions.TemplateSyntaxError: expected name or number). Everywhere I've checked most people have been ...
user avatar
0 votes
0 answers
31 views

Pset8 Finance won't pass values to index.html

I have tried like every combination and there is no error but Jinja won't pass any value to my index.html. Running the SQL on the DB gives the correct answer! And I See a Table with head and foot etc ...
user avatar
0 votes
1 answer
29 views

CS50 Final Project Jinja For Loop Not Running

My final project is a task website that allows you to create tasks, complete them, and get alerted when you haven't done a task on time. Currently, I am working on alerting when the task is due. The ...
user avatar
  • 67
0 votes
2 answers
71 views

Finance - Index showing correct number of rows but all the same record. For- loop issue?

So I've been looking at this all morning and can't figure what I'm doing wrong. All my variables are producing the correct values so it seems to be something to do with my For loop. In the html ...
user avatar
  • 9
0 votes
0 answers
31 views

FINANCE: how to commafy numbers in jinja?

I was wondering about how to commafy large digits in jinja so that instead of [$10000 / $100000 / $1000000] these numbers would be displayed as such [$10,000 / $100,000 / $1,000,000] I've been looking ...
user avatar
  • 35
0 votes
0 answers
444 views

Problem with endblock tag in finance. "endblock" tag unknown

{% extends "layout.html" %} {% block title %} Quote {% endblock %} {% block main %} <form action="/quote" method="post"> <div class="form-...
user avatar
0 votes
1 answer
28 views

My jinja not working like it should pset6 survey

So I'm currently working on pset7 survey and am about to finish. I just have to display my table in sheet.html. When run, I only get the headers right and afterwards I get nothing. Am I doingsomething ...
user avatar
  • 9
0 votes
1 answer
32 views

jinja not displaying in single statement

I think I'm missing something extremely simple, but I'm trying to display the users name in my index.html, but i'm just getting blank HTML/Jinja: Welcome, <th>{{ user_data.username }} </th&...
user avatar
  • 37
0 votes
1 answer
58 views

Pset 7 - Index. I have no idea why Jinja isn't iprinting my values

I honestly have no idea why jinja isn't putting any values on my page right now. The syntax seems to be correct, I even referenced it against the staff solution. Can someone point me in the right ...
user avatar
1 vote
0 answers
1k views

Serve pure html files without jinja in flask

As I am making my final project I get stuck at some points where I don't wish to use jinja as I wish to have my html file as a whole without extending any layout html file. In flask render_template ...
user avatar
  • 302
0 votes
0 answers
818 views

jinja filters and javascript functions

I am preparing my final project and I am stuck with calling javascript functions in my jinja template which is actually not right as jinja executes server side whereas js executes client side. I can ...
user avatar
  • 302
0 votes
1 answer
503 views

Pset7 Finance, Sell problem with POST requests

My problem is that I'm not getting any value back from my select form. I pass a list of stocks to the jinja template via return render_template("sell.html", stocks=stocks) and on the sell.html page I ...
user avatar
  • 15
0 votes
1 answer
145 views

Pset 7 total not working

My index.html {% extends "layout.html" %} {% block title %} Portfolio {% endblock %} {% block main %} <!-- Seen from HTML of finance.cs50.net--> <!-- making an int for storing the ...
user avatar
  • 1
0 votes
2 answers
130 views

pset 7 [buy] Unable to render user's cash

I've spent a lot of time trying to solve this problem and can't seem to find were I went wrong. Any help is greatly appreciated. I am unable to render the user's cash balance on the index. def ...
user avatar
  • 231
1 vote
1 answer
48 views

How to disable a table (portfolio) in index.html?

If there are no records in my portfolio, I do not want to show the table in index.html So, I tried as a parameter to pass a variable empty with value to index.html, where it was checked {% if {{ ...
user avatar
0 votes
1 answer
3k views

How to iterate through different shares in jinja to create the table in index.html

I'd appreciate some help generating the required table for index.html. My code for the index() route within application.py is below: # call this part A - accessing the data in the "transactions" ...
user avatar
0 votes
1 answer
269 views

Pset7: How to get "Bought!" Alert in /Index when re-directing from /Buy (I tried IF condition, but failed) [duplicate]

I can't figure out how to get the "Bought!" alert into the HTML template. Can someone help me out? On the left is the "Brought!" alert i want. On the right is an exhibition of my noob-ness. Here is ...
user avatar
  • 179
0 votes
1 answer
2k views

Jinja - for loop

stuck trying a for loop in jinja. I have a list/array called "priceNow" with 4 items "prices" in there. But i can't seem to get it to display in html via Jinja. 1) Here is the code that doesn't work, ...
user avatar
  • 179
1 vote
1 answer
5k views

Pset7, Index: How to use loops in Python and Jinja?

I felt like I could understand the for loops great in c, but seem to be hitting a wall here. Some generic conceptual questions before i get into it: 1) ANSWERED. what sequence does the program run, ...
user avatar
  • 179
0 votes
1 answer
137 views

Pset7, Index, why does it not show other stocks i own?

I'm trying to get all stocks to just show up on my index screen, but can't seem to get my head around the jinja template + Python + SQL commands. Can someone tell me why is it that only my last ...
user avatar
  • 179
0 votes
1 answer
70 views

Why did CS50, 2017 swap from HTML/CSS to Jinja for Pset7?

Any practical reason why the swap? Must have taken a lot of effort.
user avatar
  • 179
1 vote
2 answers
360 views

CS50 Pset7: rows inside the for loop are not showing up in index.html

I have been trying to implementing my code for Index and index.html. My code for Index seems to work very well, but my index.html isn't. My implementation of index() and index.html are pasted below. ...
user avatar
  • 121
2 votes
2 answers
674 views

Using jinja to render template based on previous url - pset7 finance

For the finance website homepage, I want to render index.html differently based on the previous url. For example, if I logged in I want to render a panel saying 'logged in', but if I registered I want ...
user avatar
  • 141
0 votes
0 answers
2k views

"jinja2.exceptions.UndefinedError: 'grand_total' is undefined" Pset7 Jinja2 and Python error

I'm still working on sell right now. After writing up my code for the route itself and then trying to test it, I found that I had a logic error on index.html and the index route with the USD amount ...
user avatar
0 votes
1 answer
958 views

pset7 index.html Jinja

In index.html, should I only be passing in one variable with all my information? I currently am passing three. They each contain their own iterable items which I need access to simultaneously. I'm ...
user avatar
  • 147
0 votes
1 answer
7k views

Jinja template exception: "jinja2.exceptions.TemplateSyntaxError"

I have an exception thrown from a template, which reads like this: "jinja2.exceptions.TemplateSyntaxError: Encountered unknown tag 'holding'. Jinja was looking for the following tags: 'endfor' or '...
user avatar
5 votes
1 answer
4k views

cs50 finance / pset-7 confused on index() table

I am trying to work on pset7, but am having a problem printing it out to the screen in the table format. I have all the values I need (the values I have are correct), but just can't figure out how to ...
user avatar
0 votes
2 answers
167 views

Jinja problem in Index PSET7

{% extends "layout.html" %} {% block title %} Index {% endblock %} {% block main %} <table style="width: 100%"> <tr> <th>Symbol</th> <th&...
user avatar