Run the server using PYTHONPATH and correct module (#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.
This commit is contained in:
Alex 2024-02-13 09:49:39 +01:00 committed by GitHub
parent aad345f0bd
commit 024c245ba7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -18,7 +18,7 @@ To run the server, please execute the following from the root directory:
```bash ```bash
pip3 install -r requirements.txt pip3 install -r requirements.txt
uvicorn main:app --host 0.0.0.0 --port {{serverPort}} PYTHONPATH=src uvicorn openapi_server.main:app --host 0.0.0.0 --port {{serverPort}}
``` ```
and open your browser at `http://localhost:{{serverPort}}/docs/` to see the docs. and open your browser at `http://localhost:{{serverPort}}/docs/` to see the docs.