flask-script Questions

4

Solved

I define my Flask application using the app factory pattern. When using Flask-Script, I can pass the factory function to the Manager. I'd like to use Flask's built-in Click CLI instead. How do I us...
Prescription asked 12/3, 2017 at 23:15

11

Solved

When using Flask-Script I get an error when importing Manager. I have installed Flask and Flask-Script. How do I fix this? manage.py from flask_script import Manager from main import app manager ...
Gauffer asked 14/5, 2021 at 16:50

7

Solved

My goal is to get arbitrary code to run after my Flask application is started. Here is what I've got: def run(): from webapp import app app.run(debug=True, use_reloader=False) Ideally I would ...
Reyna asked 14/12, 2014 at 1:40

4

In fact I cannot use any pakage now! importerror: no module named flask.ext.script importerror: no module named Pymongo
Confucian asked 12/11, 2015 at 15:49

1

Solved

Is there a way (in uWSGI or Flask) to register a function to be run in each worker after spawning but as soon as possible? We have a flask app that benefits from preloading a bunch of stuff. The f...
Prickly asked 20/3, 2019 at 18:57

1

Solved

With my app I am using flask-script and flask-migrate for database migrations, everything works locally. When, I run heroku run python manage.py db init It creates this output: Running python ...
Calabresi asked 26/9, 2017 at 15:7

1

Solved

I am using flask-script to run my app: if __name__ == "__main__": manager.run() In docker I have the following: CMD [ "python", "manage.py", "runserver", "-h", "0.0.0.0", "-p", "5000"] Now w...
Swec asked 25/10, 2016 at 21:40

1

Solved

I used these lines to start my application: from app import app app.run(host='0.0.0.0', port=8080, debug=True) Using Flask-Migrate, I have this instead: from app import manager manager.run() ...
Jadeite asked 16/1, 2016 at 8:24

2

Solved

Traditionally, I have configured the UWSGI configuration file to call an application like below: mydirectory/uwsgi_application.ini ... #python module to import app = run_web module = %(app) callab...
Scrogan asked 9/6, 2015 at 0:39

1

Solved

I'm creating an flask application with the application factory approach, but have an issue when using Flask-Migrate with socketio and flask-script. The problem is that I'm passing my create_app fu...
Marras asked 26/5, 2015 at 9:31

1

Solved

I'm building flask application and decided to try application factory approach this time, but got into trouble with flask-migrate and can't figure out simple solution. Please note that I want to p...
Frigidaire asked 26/4, 2015 at 2:6

1

Solved

Is it possible to run a function before the first request to a specific blueprint? @my_blueprint.before_first_request def init_my_blueprint(): print 'yes' Currently this will yield the followin...
Antonelli asked 9/12, 2014 at 18:20

1

I'm trying to get access to the current app instance from a Flask-Script manager.command. This errors out (url_map is a property of flask.app) @manager.command def my_function(): x = app.url_ma...
Eberly asked 12/9, 2014 at 14:46
1

© 2022 - 2024 — McMap. All rights reserved.