Questions tagged [flask-script]

61 questions
3
votes
1 answer

Reading from standard input using Flask-Script / Python

Right now I have flask-script command that takes a path as an argument, then reads from the path: @manager.option('-f', '--file', dest='file_path') def my_command(file_path): open(file_path) ... I'd want it to be able to read from…
Sherwin Yu
  • 3,180
  • 2
  • 25
  • 41
3
votes
3 answers

flask manage.py runserver can't pass parameter

user manager.py runserver my flask webframework can start on http://127.0.0.1:5000 but it can not access on other computer in network. so i need use an open IP in network. although i use bellow command: manage.py runserver 192.168.49.25:8000 it can…
kaku21
  • 129
  • 1
  • 1
  • 11
2
votes
1 answer

Cant get Flask app and another function to run together using Flask Script

I've got a raspberry pi and I've managed to get to separate elements working independently. On to sense motion and take a picture, another to stream the cameras feed over my local network using Flask. However i want these to run simultaneously, I've…
Pedroson
  • 109
  • 8
2
votes
0 answers

Integrating Flask-APScheduler with flask-migrate and flask Script

I am not clear on how to integrate my models, using flask-script, and scheduled jobs on the same database. There appears to be some work under the hood with Flask-apscheduler where it creates the database for you. When I run python manage.py db init…
spitfiredd
  • 2,897
  • 5
  • 32
  • 75
2
votes
2 answers

ValueError: Attempted relative import in non-package for running standalone scripts In Flask Web App

I have flask web app and its structure is as follows: /app /__init__.py /wsgi.py /app /__init__.py /views.py /models.py /method.py /common.py /db_client.py /amqp_client.py …
Aditi Sharma
  • 303
  • 2
  • 14
2
votes
1 answer

flask script file structure

what does "python manage.py runserver" runs in situation below. It does not run main.py or app package. flask myApp main.py bash> python main.py flask_script manage.py myApp __init__.py main.py bash> python manage.py…
ali shirzad
  • 115
  • 2
  • 9
2
votes
3 answers

Flask-Script command that passes all remaining args to nose?

I use a simple command to run my tests with nose: @manager.command def test(): """Run unit tests.""" import nose nose.main(argv=['']) However, nose supports many useful arguments that now I could not pass. Is there a way to run nose…
ddinchev
  • 33,683
  • 28
  • 88
  • 133
2
votes
1 answer

How can I use ptiPython with Flask-Script together?

In Django, I can use ptiPython instead of IPython after enabling Django-Extensions plugin to enforce Django-Shell. In Flask world, the alternative one of seems to be Flask-Script, I searched around but could not find anything to use ptiPython with…
Kane Blueriver
  • 4,170
  • 4
  • 29
  • 48
2
votes
1 answer

IO Error - Flask-mail and running server with proxy

I'm with a very very wierd bug... I have a flask app using flask-mail to send email messages. In a RedHat Server, I tryied using runserver (flask-manager) and gunicorn. So I have a apache server connecting to this app using Proxy. When I run the…
mariomol
  • 667
  • 1
  • 7
  • 15
2
votes
0 answers

How can I integrate flask-socketio and flask-script

I have been following the example of miguelgrinberg here. It works fine when run it. I submitted to heroku and works fine too. However when I am trying to integrate with flask-script I get this error: File…
carlos.rivera
  • 71
  • 1
  • 7
2
votes
0 answers

How do I pass flask-script options to children

I have the following three modules (based on Miguel Grinberg's excellent book): __init__.py from flask import Flask from config import config def create_app(config_name): app = Flask(__name__) app.config.from_object(config[config_name]) …
Kevin McKenzie
  • 627
  • 3
  • 18
2
votes
1 answer

Importing Flask app when using app factory and flask script

This is Flask app context app = Flask(__name__) with app.app_context(): # insert code here Most of the use cases of app context involves having 'app' initialized on the same script or importing app from the base. My application is structured…
lustdante
  • 483
  • 4
  • 14
1
vote
1 answer

Module installed but Python cannot find it

I am using VS Code running Python 3.9 I have set up a virtual environment using pipenv shell and I installed flask-script as displayed here in my pipfile: [packages] flask = "*" sqlalchemy = "*" flask-sqlalchemy = "*" flask-script =…
1
vote
0 answers

Load arguments before calling Flask Manager command

I need to add some preconfig params to setup app before running manager's run method and I need to get them using arguments. Once, I get them run_app will do the rest. My issue here is the following: the only way to pass arguments to manager is to…
tul1
  • 412
  • 1
  • 6
  • 22
1
vote
1 answer

flask_script issue python 3.4

The CentOS system I am on can't find flask_script. I have installed Flask-Script (see below) no luck (see bottom of post) Any suggestions? Thanks, Richard sudo pip install Flask-Script [sudo] password for : Requirement already satisfied:…
user2945234
  • 418
  • 6
  • 12