In development mode, I have the following directory tree :
| my_project/
| setup.py
| my_project/
| __init__.py
| main.py
| conf/
| mypro
I don't think there is a clean way to deal with that. You could simply choose to test for the existence of the 'local' file, which would work in dev mode. Otherwise, fall back to the production path:
import os.path
main_base = os.path.dirname(__file__)
config_file = os.path.join(main_base, "conf", "myproject.conf")
if not os.path.exists(config_file):
config_file = PROD_CONFIG_FILE # this could also be different based on the OS