import function from a file in the same folder
To import from the same folder you can do:
from .config import function_or_class_in_config_file
or to import the full config with the alias as you asked:
from ..app import config as Config
# imports all functions import config# you invoke it this wayconfig.my_function()
or
# import specific functionfrom config import my_function# you invoke it this waymy_function()
If the app.py is invoked not from the same folder you can do this:
# csfp - current_script_folder_pathcsfp = os.path.abspath(os.path.dirname(__file__))if csfp not in sys.path: sys.path.insert(0, csfp)# import it and invoke it by one of the ways described above