Code

Opened 8 years ago

Closed 8 years ago

Last modified 8 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
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: UI/UX:

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.

Attachments (0)

Change History (3)

comment:1 Changed 8 years ago by ubernostrum

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 Changed 8 years ago by adrian

  • Resolution set to wontfix
  • Status changed from new to closed

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 Changed 8 years ago by lukeplant

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.

Add Comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
as The resolution will be set. Next status will be 'closed'
The resolution will be deleted. Next status will be 'new'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.