Hello.
I would like to send an email to Python this time.
Create html files in advance I want to make html code by delivering the factor value like the render_template of flask.
tmpHtml = render_template("welcome.html" , username="tius1234")
When I tried to use the render_template of the flask, it couldn't work with the simple main() program, and I had to use it in the same form as the app.run()...
So I'm looking for another way.
Or is it possible to implement functions such as crontab using flask? The flask I know is a response through url call.
If you can use it on the flask, I don't think that's a problem. (Sending mail every hour of a certain cycle, etc.))
I ask for your help me.
Then have a good day today.
python flask render_template
To implement features like CronTab You can use a module called aps. flask extension also exists.
In the case of template engine, jinja2 template seems to be a good choice because there are many implementations in other languages.
Somehow, I found it.
import jinja2
tmpHtml = jinja2.Environment(loader=jinja2.FileSystemLoader("PATH")).get_template("FILE").render({username:"tius1234"})
If you know a better way, please give us your opinion ^
^
574 Who developed the "avformat-59.dll" that comes with FFmpeg?
572 rails db:create error: Could not find mysql2-0.5.4 in any of the sources
611 GDB gets version error when attempting to debug with the Presense SDK (IDE)
915 When building Fast API+Uvicorn environment with PyInstaller, console=False results in an error
618 Uncaught (inpromise) Error on Electron: An object could not be cloned
© 2024 OneMinuteCode. All rights reserved.