File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -988,8 +988,8 @@ def module(self) -> str:
988988 Returns:
989989 The module name.
990990 """
991- if self .app_module is not None :
992- return self .app_module . __name__
991+ if self .app_module_import is not None :
992+ return self .app_module_import
993993 return "." .join ([self .app_name , self .app_name ])
994994
995995 def update_from_env (self ) -> dict [str , Any ]:
Original file line number Diff line number Diff line change @@ -301,8 +301,12 @@ def get_reload_paths() -> Sequence[Path]:
301301 """
302302 config = get_config ()
303303 reload_paths = [Path (config .app_name ).parent ]
304- if config .app_module is not None and config .app_module .__file__ :
305- module_path = Path (config .app_module .__file__ ).resolve ().parent
304+ if (
305+ config .app_module_import is not None
306+ and (spec := importlib .util .find_spec (config .app_module_import )) is not None
307+ and spec .origin
308+ ):
309+ module_path = Path (spec .origin ).resolve ().parent
306310
307311 while module_path .parent .name and any (
308312 sibling_file .name == "__init__.py"
You can’t perform that action at this time.
0 commit comments