flask

Python – using flask blueprint and CAS

I am trying to develop a Python app that uses flask with blueprint, and some of these "applications/forms" will need to login to CAS. We have CAS working – that’s not the problem here.
My file/folder structure is as follows:
~/….

how to return image into img src

”’
@app.route(‘/file/’)
def data_file(filename):
return mongo.send_file(filename)
@app.route(‘/show/’)
def show(username):
user = filerr.find_one_or_404({‘username’: username})
return ”’
<h1>success</h1>
<img width…

Python Flask SQLALCHEMY

I have problems with the sqlalchemy of the flask. I write this and I get an error. How can I solve my problem. See the code.
from flask import Flask,render_template
from flask_sqlalchemy import SQLAlchemy
app = Flask(__name__)
app.config[‘…

Python Jinja2 filtering

if my table is like this

how can I output the number of events with the same name, like test should be 5 and hello should be 3.
Edit:
Here’s my Jinja2 code snippet
{% for event in events %}
{% set count = 0 %}