Skip to content

Instantly share code, notes, and snippets.

@NoRePercussions
Created July 12, 2023 21:38
Show Gist options
  • Save NoRePercussions/00a26a4d801a91b01a916f818dd27092 to your computer and use it in GitHub Desktop.
Save NoRePercussions/00a26a4d801a91b01a916f818dd27092 to your computer and use it in GitHub Desktop.
from flask import Flask, render_template
from flask_injector import FlaskInjector
app = Flask(__name__)
@app.route('/')
def hello_world(): # put application's code here
return render_template("helloworld.html")
FlaskInjector(app=app, modules=[])
if __name__ == '__main__':
app.run()
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Hello World</title>
</head>
<body>
{% with messages = get_flashed_messages() %} {# F-I tries to resolve something? #}
{% if messages %}
<ul class=flashes>
{% for message in messages %}
<li>{{ message }}</li>
{% endfor %}
</ul>
{% endif %}
{% endwith %}
</body>
</html>
Flask~=2.1.3
Flask-Injector~=0.14.0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment