You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Mar 10, 2020. It is now read-only.
Repository navigation
This repository was archived by the owner on Mar 10, 2020. It is now read-only.
The app argument to mycommand seems wrong; if I try to follow that pattern I get an error:
usage: manage.py runserver [-?] app
manage.py runserver: error: the following arguments are required: app
The example code code at https://github.com/smurfix/flask-script/blob/master/examples/manage.py works differently and it seems correct; if I remove the app argument from mycommand and use flask.current_app instead, everything works. Is this a mistake in the documentation or am I missing something?
@amagee that code would never work, since mycommand(app) is expecting a Flask object to be passed as a parameter in the shell, which is obviously impossible. You can only pass strings, which is all you see being passed in the example. Optional arguments (like url=None) need to be passed in the shell like this: --url=test.
In your example, you either have to remove app from the parameter and instantiate it somewhere in the module instead of in a method, or declare app as global.
Activity
dorneanu commentedon Oct 14, 2014
I'm issuing the same thing.
@amagee Thanks for the hint.
Meanwhile I was able to solve it this way:
Afterwards I can run:
Edit:
Have a look at https://github.com/dorneanu/crudappify/tree/master/apps/orgapp.
nfvs commentedon Dec 10, 2014
@amagee that code would never work, since
mycommand(app)is expecting a Flask object to be passed as a parameter in the shell, which is obviously impossible. You can only pass strings, which is all you see being passed in the example. Optional arguments (likeurl=None) need to be passed in the shell like this:--url=test.In your example, you either have to remove
appfrom the parameter and instantiate it somewhere in the module instead of in a method, or declareappas global.