How can i pass a variable to a blueprint from the apps main file
Lets say i had the following sample app.
#app.py
from flask import Flask
from example_blueprint import example_blueprint
data_to_pass="Hurray, You passed me"
app = Flask(__name__)
app.register_blueprint(example_blueprint)
#Blueprint
from flask import Blueprint
example_blueprint = Blueprint('example_blueprint', __name__)
@example_blueprint.route('/')
def index():
return "This is an example app"
How do i pass data_to_pass
to the blueprint ??
Is there a flask inbuilt way?
I am trying to avoid importing the whole app.py
file...it doesnt seem elegant.