Skip to content

Commit 09eba78

Browse files
AlexanderWillnerkota65535
authored andcommitted
Run the server using PYTHONPATH and correct module (OpenAPITools#17820)
Executing the command from the README file should allow the user to run the application. Without the proposed changes either the error message `Error loading ASGI app. Could not import module "main".` or `ModuleNotFoundError: No module named 'openapi_server'` is being returned.
1 parent b4a933f commit 09eba78

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

modules/openapi-generator/src/main/resources/python-fastapi/README.mustache

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ To run the server, please execute the following from the root directory:
1818

1919
```bash
2020
pip3 install -r requirements.txt
21-
uvicorn main:app --host 0.0.0.0 --port {{serverPort}}
21+
PYTHONPATH=src uvicorn openapi_server.main:app --host 0.0.0.0 --port {{serverPort}}
2222
```
2323

2424
and open your browser at `http://localhost:{{serverPort}}/docs/` to see the docs.

0 commit comments

Comments
 (0)