File tree Expand file tree Collapse file tree 1 file changed +10
-8
lines changed
Expand file tree Collapse file tree 1 file changed +10
-8
lines changed Original file line number Diff line number Diff line change 1- # In this sample, the Flask app object is contained within the hello_app *module*;
2- # that is, hello_app contains an __init__.py along with relative imports. Because
3- # of this structure, a file like webapp.py cannot be run directly as the startup
4- # file through Gunicorn; the result is "Attempted relative import in non-package".
5- #
6- # The solution is to provide a simple alternate startup file, like this present
7- # startup.py, that just imports the app object. You can then just specify
8- # startup:app in the Gunicorn command.
1+ """
2+ In this sample, the Flask app object is contained within the hello_app *module*;
3+ that is, hello_app contains an __init__.py along with relative imports. Because
4+ of this structure, a file like webapp.py cannot be run directly as the startup
5+ file through Gunicorn; the result is "Attempted relative import in non-package".
6+
7+ The solution is to provide a simple alternate startup file, like this present
8+ startup.py, that just imports the app object. You can then just specify
9+ startup:app in the Gunicorn command.
10+ """
911
1012from hello_app .webapp import app
You can’t perform that action at this time.
0 commit comments