configuration-files

Packaging Python applications with configuration files

走远了吗. 提交于 2021-02-06 01:53:00
问题 I'm using ConfigParser for configuring my application, and now I want to make it easily distributable, and at the same time preserve the configurability. I'm thinking I need a directory with configuration file templates, and some way of generating the configuration to actually use from these. Then I need a place to store it that will work in virtualenv, the users home directory etc. I want it to be as close to how normal Unix packages work, i.e. have config in etc, but with overrides in home

Packaging Python applications with configuration files

你离开我真会死。 提交于 2021-02-06 01:52:12
问题 I'm using ConfigParser for configuring my application, and now I want to make it easily distributable, and at the same time preserve the configurability. I'm thinking I need a directory with configuration file templates, and some way of generating the configuration to actually use from these. Then I need a place to store it that will work in virtualenv, the users home directory etc. I want it to be as close to how normal Unix packages work, i.e. have config in etc, but with overrides in home

Packaging Python applications with configuration files

落花浮王杯 提交于 2021-02-06 01:51:20
问题 I'm using ConfigParser for configuring my application, and now I want to make it easily distributable, and at the same time preserve the configurability. I'm thinking I need a directory with configuration file templates, and some way of generating the configuration to actually use from these. Then I need a place to store it that will work in virtualenv, the users home directory etc. I want it to be as close to how normal Unix packages work, i.e. have config in etc, but with overrides in home

Packaging Python applications with configuration files

大憨熊 提交于 2021-02-06 01:50:43
问题 I'm using ConfigParser for configuring my application, and now I want to make it easily distributable, and at the same time preserve the configurability. I'm thinking I need a directory with configuration file templates, and some way of generating the configuration to actually use from these. Then I need a place to store it that will work in virtualenv, the users home directory etc. I want it to be as close to how normal Unix packages work, i.e. have config in etc, but with overrides in home

Microsoft.Configuration.Extensions: How to get section / complex value as json string?

送分小仙女□ 提交于 2021-01-29 10:59:32
问题 When we have configuration like this // appsettings.json { "SomeServiceConfiguration": { "Server": "127.0.0.1", "Port": "25" } } it is possible to use binding to access data: IConfiguration configuration = ...; var section = configuration.GetSection("SomeServiceConfiguration"); var val = section.Value; // this is null var t = new SomeServiceConfiguration(); section.Bind(t); But is it possible to get value (section content) "just as string" (by the fact as json) {"Server": "127.0.0.1", "Port":

What is the intended use of the DEFAULT section in config files used by ConfigParser?

99封情书 提交于 2021-01-20 21:00:24
问题 I've used ConfigParser for quite a while for simple configs. One thing that's bugged me for a long time is the DEFAULT section. I'm not really sure what's an appropriate use. I've read the documentation, but I would really like to see some clever examples of its use and how it affects other sections in the file (something that really illustrates the kind of things that are possible). 回答1: I found an explanation here by googling for "windows ini" "default section". Summary: whatever you put in

How can I configure NLog in .NET Core with appsettings.json instead of an nlog.config file?

六月ゝ 毕业季﹏ 提交于 2021-01-20 16:42:35
问题 The NLog documentation explains how to configure NLog for .NET Core applications by using an nlog.config XML file. However, I'd prefer to have just one configuration file for my application - appsettings.json . For .NET Framework apps, it's possible to put the NLog configuration in app.config or web.config . Is it possible to put the NLog config in appsettings.json in the same way? For example, how could I put this configuration example from the NLog documentation for ASP.NET Core 2 into

How can I configure NLog in .NET Core with appsettings.json instead of an nlog.config file?

五迷三道 提交于 2021-01-20 16:41:18
问题 The NLog documentation explains how to configure NLog for .NET Core applications by using an nlog.config XML file. However, I'd prefer to have just one configuration file for my application - appsettings.json . For .NET Framework apps, it's possible to put the NLog configuration in app.config or web.config . Is it possible to put the NLog config in appsettings.json in the same way? For example, how could I put this configuration example from the NLog documentation for ASP.NET Core 2 into