Skip to content

module has no attribute 'load' #6

Description

@HaraldTR

Trying to run uvicorn_hmr programmatically, but getting issues. On newest FastAPI / Starlette / uvicorn.

# __main__.py
from pathlib import Path
import sys
import uvicorn_hmr

if __name__ == "__main__":
    app_path = 'src.server:app'  
    cwd = Path.cwd()
    
    if str(cwd) not in sys.path:
        sys.path.insert(0, str(cwd))

    uvicorn_hmr.main(
        slug=app_path,
        host="0.0.0.0",
        port=8000,
        log_level="debug",
        reload_include=str(cwd / "src"),
        reload=False
    )
Traceback (most recent call last):
  File "/venv/lib/python3.12/site-packages/uvicorn_hmr.py", line 91, in run_entry_file
    self.entry_module.load()
AttributeError: module 'src.server' has no attribute 'load'

No activity

Activity on this issue will appear here.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

coreRelated to the `hmr` package

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions