In development mode, I have the following directory tree :
| my_project/
| setup.py
| my_project/
| __init__.py
| main.py
| conf/
| myproject.conf
I use ConfigParser to parse the myproject.conf
file.
In my code, it's easy to load the file with a good path : my_project/conf/myproject.conf
The problem is : When I install my project using the setup.py, the configuration file are situated (thanks to setup.py) in the /etc/my_project/myproject.conf
and my application in the /usr/lib/python<version>/site-packages/my_project/
.
How can I refer my my_project/conf/myproject.conf
file in my project in "production" mode, and refer to the local file (my_project/conf/myproject.conf
) in "devel" mode.
In addition, I would like to be portable if possible (Work on windows for example).
What's the good practice to do that ?