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
Fix Issue 1847 - Adding Current Path when Invoking Flask-Cli Run #1863
Conversation
…n issue when creating app.
Strong 👎; IMO people should add a setup.py |
@@ -398,6 +398,8 @@ def run_command(info, host, port, reload, debugger, eager_loading, | |||
The reloader and debugger are by default enabled if the debug flag of | |||
Flask is enabled and disabled otherwise. | |||
""" | |||
import sys |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
Sure, but the fact is that the behaviour between |
A setup.py makes perfect sense even if you never intend to publish your package on PyPI. It's how your register a package properly within your Python environment. |
You can already set
All of this is poorly documented and a few instances in the quickstart are completely wrong (i.e. nonfunctional) in 0.11 and only fixed in master. If you find any other instances where this behavior could be clarified, feel free to point them out. Thanks! |
@untitaker there appears to be some path issues with pointing at |
I would expect to be able to point to Maybe we could be smarter about when we add the current directory to the path, or output a warning to use setup.py instead when we do. |
Either way, we need a clearer message when this fails, rather than just dumping an
|
Not a fan of forcing folks to use a |
See #1872, I think this got fixed. |
@jeffwidman I don't think that's possible at all. How would the command know which package/file to import? |
Yeah, you're right. I am so used to accessing |
Fix for: #1847
Adds the current directory to the Python path, when invoking a local development server.
flask run
was unable to find the app's module in the PYTHONPATH, whilepython -m flask run
adds the current working directory to the PYTHONPATH automatically.