Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

using app = Flask(__name__) #38

Closed
starenka opened this issue Nov 6, 2017 · 2 comments
Closed

using app = Flask(__name__) #38

starenka opened this issue Nov 6, 2017 · 2 comments

Comments

@starenka
Copy link

starenka commented Nov 6, 2017

When using app = Flask(__name__) (as stated in doc), your management script won't work dying on cryptic import like:

(tvocr) starenka /work/tvocr master at a7d02b8? % manage.py rq worker default
Traceback (most recent call last):
  File "/data/.envs/tvocr/bin/manage.py", line 6, in <module>
    exec(compile(open(__file__).read(), __file__, 'exec'))
  File "/work/tvocr/tvocr/api/manage.py", line 13, in <module>
    manager.run()
  File "/data/.envs/tvocr/local/lib/python2.7/site-packages/flask_script/__init__.py", line 417, in run
    result = self.handle(argv[0], argv[1:])
  File "/data/.envs/tvocr/local/lib/python2.7/site-packages/flask_script/__init__.py", line 386, in handle
    res = handle(*args, **config)
  File "/data/.envs/tvocr/local/lib/python2.7/site-packages/flask_rq2/script.py", line 42, in __call__
    return self.run(*args, **kwargs)
  File "/data/.envs/tvocr/local/lib/python2.7/site-packages/flask_rq2/script.py", line 180, in run
    queues=queues or self.rq.queues,
  File "/data/.envs/tvocr/local/lib/python2.7/site-packages/rq/cli/cli.py", line 175, in worker
    worker_class = import_attribute(worker_class)
  File "/data/.envs/tvocr/local/lib/python2.7/site-packages/rq/utils.py", line 150, in import_attribute
    module = importlib.import_module(module_name)
  File "/usr/lib/python2.7/importlib/__init__.py", line 37, in import_module
    __import__(name)
ImportError: No module named backend_tvocr.api.app

using app = Flask('somename') would work fine.

Not sure if I missunderstand flask or rq2 or both, but bare with me and maybe fix the docs (or the code) ;)

@jezdez
Copy link
Member

jezdez commented Dec 4, 2017

Heeey, so I dropped support for flask-script because I wasn't able to maintain both systems, Flask's official CLI support as well as the legacy flask-script system. The refactor that drops it landed in #41.

@jezdez jezdez closed this as completed Dec 4, 2017
@starenka
Copy link
Author

starenka commented Dec 4, 2017

Ok. Thanks for looking into it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants