Why shouldn't you put config options in py files

James Matthews nytrokiss at gmail.com
Thu Dec 4 22:34:19 CET 2008

I am going to have to agree with your colleague. I use Django a lot and you
are editing config.py and urls.py which are all python code.

On Thu, Dec 4, 2008 at 10:30 PM, Bruno Desthuilliers <
bdesth.quelquechose at free.quelquepart.fr> wrote:

> HT a écrit :
>> A colleague of mine is arguing that since it is easy to write config like:
>> FOO = {'bar': ('a': 'b'), 'abc': ('z': 'x')}
>> in config.py and just import it to get FOO, but difficult to achieve the
>> same using an ini file and ConfigParser, and since Python files are just
>> text, we should just write the config options in the Python file and
>> import it.
>> I can think of lots of arguments why this is a bad idea, but I don't
>> seem to be able to think of a really convincing one.
>> Anyone?
> Well... Depends on who is writing these config files and how they are used.
> But at least one major Python software (namely Django) uses .py setting
> files, and a Python developper I'm grateful they do - this greatly
> simplifies my job.
> --
> http://mail.python.org/mailman/listinfo/python-list


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20081204/979a7097/attachment.html>

More information about the Python-list mailing list