Questions tagged [jinja]
The jinja tag has no usage guidance.
34
questions
0
votes
1
answer
77
views
Check50 PSET9 Finance Failing Throughout
First post here...seems I'm coming unstuck at the pointy end of the course. Hahaha!
My code doesn't seem to be passing Check50 through Quotes/Buy/Sell - although the functionality seems to be fine ...
0
votes
1
answer
67
views
Finance app - object is not subscriptable
I have problems with pset 9 finance.
Since days I try to figure out what is wrong with my code for the sell route.
I know that there a handfull of similar questions on StackExchange/StackOverflow but ...
0
votes
2
answers
110
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 ...
0
votes
1
answer
693
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 ...
0
votes
1
answer
936
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>
...
0
votes
0
answers
280
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 ...
0
votes
1
answer
3k
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
0
answers
36
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
1
answer
37
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
2
answers
91
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
0
answers
42
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
0
answers
730
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
1
answer
29
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
1
answer
35
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
1
answer
59
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 ...
1
vote
0
answers
2k
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
0
answers
1k
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
1
answer
510
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
1
answer
147
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
2
answers
133
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
1
answer
49
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
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" ...
0
votes
1
answer
286
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
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, ...
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, ...
0
votes
1
answer
138
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
1
answer
72
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
2
answers
370
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
2
answers
785
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
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 ...
0
votes
1
answer
965
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
1
answer
8k
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
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 ...
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&...