Closed eshijia closed 7 years ago
jsglue.js
is generated in the flask_jsglue.py
module. Look at the generate_js
if you want to see the source. It's made available in the application by adding a route to a Flask
object, which causes it to be generated on the fly.
If you're getting errors about it being missing, though, I'm betting you didn't do the initial set up correctly. As indicate by the docs, you need to initialize it when you initialize the Flask
object. You do this one of two ways:
Call init_app
:
from flask import Flask
from flask_jsglue import JSGlue
app = Flask(__name__)
jsglue = JSGlue()
jsglue.init_app(app)
or
Pass the Flask
object to the JSGlue
initializer:
from flask import Flask
from flask_jsglue import JSGlue
app = Flask(__name__)
jsglue = JSGlue(app)
I found the module need a javascript file called
jsglue.js
, but where should I get that file?