Skip to content

Tag: flask

how to iterate over one field in jinja2

I have a database that looks like this: and I want to group the rows on country and display with something like this: The above doesn’t seem to work as the first for loop results in the following error: Is it possible to extract just one column, and use that to group the rows, just by using jinja2 (i.e.…

Python + pdfkit: Generate stream with pdfkit

I’m trying to use pdfkit to turn html pages into PDFs, and then return a stream of that PDF as this code is a Flask API called by a webpage. As far as I can tell, when you use pdfkit.from_file, you have provide both an input and output path: The problem is, I don’t want to write these files to

How to recalculate data from table in flask/python?

I want to show df in my app, im using flask to do it. But how can i make the table editable and calculated sum value by using button? I couldn’t found good and easy way to edit that html table, and somehow send it to backend to recalculate. Most tips i found abuot editables tables involve data from sql

Logger not creating logs on log file in flask application;

I want to create logs in my log file, logs can be shown on the terminal but not written on the log files. I created a package imp_calc which has templates and other files inside it, accessing it using run.py which accesses the imp_calc package’s modules. My folder structure is as follows: my init.py fil…