0
While running flash run, I get the following error:
Error: Detected Factory 'create_app' in module 'spcdados.app', but could not call it without Arguments. Use "FLASK_APP='spcdados.app:create_app(args)'" to specify Arguments.
My structure is this:
My config files are as follows:
#app.py
from flask import Flask, abort, url_for, render_template
from spcdados.extensoes import configuration
def minimal_app(**config):
app = Flask(__name__)
configuration.init_app(app, **config)
return app
def create_app(**config):
app = minimal_app(**config)
configuration.load_extensions(app)
return app
#settings.toml
[default]
DEBUG = false
SQLALCHEMY_DATABASE_URI = 'sqlite:///development.db'
TITLE = "SPC DADOS"
SECRET_KEY = "Pocornio2233"
EXTENSIONS = [
"spcdados.extensoes.appearence:init_app",
"spcdados.extensoes.database:init_app",
"spcdados.extensoes.auth:init_app",
"spcdados.extensoes.admin:init_app",
"spcdados.extensoes.commands:init_app",
"spcdados.blueprints.views:init_app",
"spcdados.blueprints.restapi:init_app"
]
#.env
FLASK_ENV = development
FLASK_APP = spcdados.app:create_app
I cannot understand where else it is necessary to declare FLASK_APP, someone has already gone through it?
Where did you spin
flask run
? Tried to useFLASK_APP = app.py
?– Lucas
I went straight to the terminal of the visual code, and yes, flask_app is already set there because I am working with it in the structure of Blueprint and Factory
– Brenda Xavier
I found the bug, apparently it’s a bug that hasn’t been fixed with flask, I modified the app.py to not receive **config anymore and it worked =)
– Brenda Xavier