Q:

How does "The Flask Mega-Tutorial" load config from above package root?

I am referring to this code in The Flask Mega-Tutorial  Github Repo
flasky/
    app.py
    config.py
    app/
        __init__.py
        ...
    ...

There is one specific line that I cannot totally understand
#__init__.py
...
from config import config
...
def create_app(config_name):
    app = Flask(__name__)
    app.config.from_object(config[config_name])
    ...
...

How is it able to import from the config.py file from outside the package root?
I did find a Dockerfile with the following entry
COPY flasky.py config.py boot.sh ./

What does this mean? Is this line somehow adding those files to the PATH ?
 Why not simply place the config.py file in the /app folder? 

A:

The same question is asked on Github, where Miguel answers it: 
https://github.com/miguelgrinberg/flasky/issues/154#issuecomment-395907521
To quote:

The config module is found because it is in the current directory. It does not matter from where it is imported, the fully qualified location for that module is just the module name. This is actually the same reason why you can say from app import .... The app package is found because it is in the current directory, same as config. Hope this clarifies it.

And further down:

You have a misunderstanding of what "current directory" means. The current directory is an operating system concept, each process has a directory that is marked as the current directory. By default, the current directory for a process is the directory from where the application was started (but the application itself can change this if it wants to). In this case, you start the application from the flasky directory, right? So that is your current directory. From any Python modules you can import config and app without problem, because the current directory is in the Python import path.

Hope that helps. 

