Re: declarative settings

2020-02-27 Thread Alexei Znamensky
Howdy, You guys ever seen or used this: https://pypi.org/project/django-configurations/ Reusable settings. That would be something I would like to see in Django. On Fri, 28 Feb 2020 at 5:49 AM, Robert Marsanyi wrote: > I have to say, having settings as Python code is one of the features of >

Re: declarative settings

2020-02-27 Thread Robert Marsanyi
I have to say, having settings as Python code is one of the features of Django for me. Being able to calculate settings values, take advantage of Python’s module/class parsing, and so on all make settings more than just a set of dictionary values. I think we would lose a bit of functionality i

Re: declarative settings

2020-02-25 Thread Adrian Turjak
Declarative settings, and a lack of a good settings file parsing system, led me into some rather interesting directions not that long ago. I maintain an OpenStack project called Adjutant, and I built it on Django, but ended up using yaml as my config file and having settings.py read it and pull in

Re: declarative settings

2020-01-05 Thread Christian González
Am 01.01.20 um 15:04 schrieb Adam Johnson: > > This seems a weird suggest, but when apps depend on another app it > should be able to override settings for that dependency too > (because it "uses" that app anyway). > > > It does seem weird to suggest. I haven't seen such a use case mys

Re: declarative settings

2020-01-05 Thread Christian González
Am 02.01.20 um 08:06 schrieb Alexei Znamensky: > Having said that, I recently stumbled on this package > django-configurationsby chance, while working on something else. It > looks quite promising, as one can use (multiple) class inheritance to > merge and combine different settings. As far as I ca

Re: declarative settings

2020-01-01 Thread Alexei Znamensky
Hi Christian, Definitely not a boring theme, but as pointed by others, there are many aspects to be taken into consideration. Having said that, I recently stumbled on this package django-configurations by chance, while working on something else. It looks quite promising, as one can use (multip

Re: declarative settings

2020-01-01 Thread Adam Johnson
> > This seems a weird suggest, but when apps depend on another app it should > be able to override settings for that dependency too (because it "uses" > that app anyway). It does seem weird to suggest. I haven't seen such a use case myself. Can you describe in more detail? For me, I can only im

Re: declarative settings

2019-12-31 Thread Christian González
Hi all, thanks for your fast response - it seems that this is not a "ah, forget it, boooring." theme. I'll try to answer all (for me) relevant things at once here - sorry to write such a huge mail. *@Adam Johnson:* > * A class to read django.conf.settings and add defaults/other logic > through pr

Re: declarative settings

2019-12-31 Thread Adam Johnson
When using settings for my third party packages I use: * A class to read django.conf.settings and add defaults/other logic through properties - for example https://github.com/adamchainz/django-cors-headers/blob/31b9c2ef8a333a40f18081ffc1f1cba9fb34574d/src/corsheaders/conf.py . This has the benefit

Re: declarative settings

2019-12-30 Thread Tom Forbes
My two cents: JSON isn’t great as a configuration language - It’s annoyingly picky about some things. YAML or TOML are “better” (for some definition of better) choices for this domain, in my option. However, Django is historically quite hesitant about including third party packages and I think i

Re: declarative settings

2019-12-30 Thread Jacob Rief
You have hit a salient point in Django. It indeed is a mess how every third party application must add its own configuration classes in order to make their own default settings configurable through a settings.py. This results in settings directives which can have any attribute name and do not fo

RE: declarative settings

2019-12-30 Thread Matthew Pava
It's an interesting idea, and I'm not opposed to it myself; however, keeping the settings as Python code is not an abnormal practice compared to other software. I've been working with some Drupal stuff lately, and it is written in PHP. Drupal is a content management system that can be extended