Skip to content
Advertisement

Tag: jinja2

Send query params from Jinja template

I can’t figure out if it’s possible to pass query parameters from a static html page to a view for processing. I have now implemented the functionality I need using path parameters. I want to do the same, but with query parameters main.py events.py routes.py html It’s works with “POST /event/invite/15/sender/3 HTTP/1.1” as a sample Try with query params And

How to Use jinja to render HTML without flask?

I need to render HTML page using jinja but without flask I read some other questions here but none had clear answer kindly let me know how can i achieve the same Here I need to render 1.html using 1.py – is it possble to do it in ofline mode current 1.py currently with this I am able to print

Images not hosted on server with flask, jinja2 and html

I want to load images from links with flask and jinja2. This is what I’m trying: I have checked that anime.cover = https://animeflv.net/uploads/animes/covers/2430.jpg, but the images won’t load. What is a possible solution? Thank you in advance! Answer First check to make sure you’re getting your anime object (I can’t tell from the question). Then, check to make sure your

How can Jinja2 read a function without passing it explicitly?

In the flask:flashing documentation, I encounter the following situation. And here is the Jinja2 used HTML file. So I wonder that even if there is no function passed in to the HTML file by using return statement in Python file, Jinja2 can read get_flashed_messages() function, which is a function under the flask module. How is this possible? Answer Messages to

flask.cli.NoAppException: Could not import “app”

My application’s name is app.py, and it’s in a folder named ToDo-App, and within this folder there is another folder called templates, that contains the index.html file. In the terminal: Esam@DESKTOP-73QDAD3 MINGW32 /i/web/advanced-track/1-sql_and_data_modeling_for_the_web/ToDo-App $ FLASK_APP=app.py FLASK_DEBUG=true flask run Serving Flask app “app.py” (lazy loading) Environment: production WARNING: This is a development server. Do not use it in a production deployment.

Advertisement