Questions tagged [jinja]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0
votes
1answer
44 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 ...
0
votes
0answers
24 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 ...
0
votes
1answer
15 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 ...
0
votes
2answers
35 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 ...
0
votes
0answers
16 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 ...
0
votes
0answers
17 views

Jinja scope help

def index(): """Show portfolio of stocks""" price = [] num = int(db.execute("SELECT count(name) FROM sqlite_master WHERE type='table' AND name='tracker'&...
0
votes
0answers
106 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-...
0
votes
1answer
27 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 ...
0
votes
1answer
24 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&...
0
votes
1answer
57 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 ...
0
votes
0answers
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 ...
0
votes
0answers
710 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 ...
0
votes
1answer
478 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 ...
0
votes
1answer
138 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 ...
0
votes
2answers
125 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 ...
1
vote
1answer
46 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 {{ ...
0
votes
1answer
2k 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" ...
0
votes
1answer
237 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 ...
0
votes
1answer
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, ...
1
vote
1answer
4k 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, ...
0
votes
1answer
136 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 ...
0
votes
1answer
66 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.
1
vote
2answers
335 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. ...
2
votes
2answers
574 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 ...
0
votes
0answers
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 ...
0
votes
1answer
943 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 ...
0
votes
1answer
5k 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 '...
5
votes
1answer
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 ...
0
votes
2answers
166 views

Jinja problem in Index PSET7

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