Opened 19 years ago

Closed 19 years ago

Last modified 18 years ago

#1337 closed enhancement (wontfix)

Convert configuration file (settings.py and urls.py) to plain text file

Reported by: limodou@… Owned by: Adrian Holovaty
Component: Core (Other) 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

I'm thinking using some tools to make apps installation easily. But I found out that is hard to modifying the settings.py and urls.py. So I suggest that whether the settings.py and urls.py can be convert to text file. Maybe you will say: if it's happened, many applications need to be converted. That's may not true, I think we can also support old-style configuration files. e.g.:

if exists(settings.py):
    import settings.py
if exists(settings.ini):
    process(settings.ini)

So two style configuration files can be proccessed. I think there are many benefits about using text configuration files, because Django is not a application, but a framework, so it'll need consider apps deployment, and even make these things easier. So how to easily modify the configration files becomes a problem, but using python file is not so easy to modify, because the syntax may be ambiguist and many hacks, so parsing it is more difficult. (I'v finished two models to deal with settings.py and urls.py, but the code is ugly and has many limits.)

If we could adopt standard ini format, or enhanced ini format(dict4ini - written by me also, ConfigObj), then change the configuration files will be very easily.

And the best benefit will be: others can easily write useful tools for deploying apps or somethings else. I'v developed some support in NewEdit to help the development about Django, so I also need this. For now, I can only using the ugly modules to do these things.

Attachments (1)

User.ini (14.6 KB ) - added by artileri88@… 12 years ago.
Configurasi Setting

Download all attachments as: .zip

Change History (3)

comment:1 by Malcolm Tredinnick <malcolm@…>, 19 years ago

This looks like a large step backwards. Your claims of ambiguous syntax and "many hacks" are not really supported here and it would be removing a lot of the power available in settings.py to make them only a text file. Generally settings.py will only be configured by somebody familiar with Django (and hence Python).

Look, for example, at the documentation file settings.txt and explain how we are to replicate something like the ABSOLUTE_URL_OVERRIDES example with only a text file. A python file can do everything you can do with a text file (via variable assignment), but not vice-versa. But you are removing things that are genuinely useful in moving to text files. So not a win at all, as far as I can see.

comment:2 by Adrian Holovaty, 19 years ago

Resolution: wontfix
Status: newclosed

I don't see how this is a step forward, either. Feel free to use this technique in your own use of the framework, but this won't be adapted into the framework proper.

by artileri88@…, 12 years ago

Attachment: User.ini added

Configurasi Setting

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