Opened 19 years ago

Closed 19 years ago

Last modified 18 years ago

#1933 closed enhancement (wontfix)

why do settings exist in code (settings.py) and not in a (potentially remote) XML config file?

Reported by: eetheband@… Owned by: Adrian Holovaty
Component: contrib.admin Version:
Severity: normal Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

After playing around with Django quite a bit (and loving it for the most part), and talking with a fellow developer friend who also gave it a whirl - we both a agreed that having settings inside actual code was really inconvenient (and bad design for the most part). Why is it like this? Why not put these 'settings' in an xml file, that can then be placed outside your build directory, for easy maintainability and reusability? -Thanks for your work.

Change History (3)

comment:1 by James Bennett, 19 years ago

Being code doesn't affect the filesystem locations that are available to you; so long as you can put that location in your PYTHONPATH it will work.

And why is it "bad design" to store settings in something that's importable and manipulable as native datatypes of the language, but "good design" to store settings in something that requires you to import a library or write special-case code just to read it?

comment:2 by Adrian Holovaty, 19 years ago

Resolution: wontfix
Status: newclosed

Having settings in Python code is a feature, not a bug. It lets you dynamically construct settings, import settings from other settings modules and do all sorts of useful things.

Using XML for configuration would be diabolical, and I wouldn't wish that on my enemies.

comment:3 by Luke Plant, 19 years ago

Obviously I agree with Adrian, but I should point out for the masochistic, or those who just have to use XML for some reason, that there is absolute nothing stopping you from doing that -- precisely because the settings is a python file, you could have it import your settings from an XML file on the file system or the web or whatever.

Note: See TracTickets for help on using tickets.
Back to Top