Skip to main content
=====
Django Confidence
=====

Django Confidence is a Django app to make configuration files automatically.

This app is developed to help developers create their own layout to configuration files quick and simple with built-in dictionaries or by using configuration presets (that make it even more easier).

Quick start
-----------

1. Add "confidence" to your INSTALLED_APPS setting like this::

INSTALLED_APPS = [
'django.contrib.admin',
'django.contrib.auth',
...
'confidence',
]

2. In your settings.py import "Configuration" class from "confidence" package like this::

from confidence import Configuration

3. Create a dictionary of config fieldsets like this::

markup = {
'section': {
'option': 'value'
},

'project': {
'project_name': 'Awesome Project',
}
}

4. In your settings.py create a variable called PROJECT_CONF and fill it with a Configuration instance::

PROJECT_CONF = Configuration(filepath:str, markup:dict)

4.1 Optional. You can use library of preset configuration files by importing from conf.presets. Example::

from confidence import Configuration
from confidence.presets import ProjectPreset, OptionsPreset

PROJECT_CONF = Configuration.compile_from_presets(filepath, [
ProjectPreset(name='Awesome Project', version='1.0', site_url='http://awesome!'),
OptionsPreset(debug=True, allowed_hosts=['127.0.0.1']),
])

5. Run python manage.py makeconf. Configuration file will be created.

6. Edit your configuration file as you want to.

7. Use it in your settings.py by using get-like methods::

PROJECT_NAME = PROJECT_CONF.get('project', 'project_name')
DEBUG = PROJECT_CONF.get_bool('options', 'debug')
ALLOWED_HOSTS = PROJECT_CONF.get_csv('options', 'allowed_hosts')

8. Enjoy!

Release files for django-confidence 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for django-confidence 0.1.0
File Size Uploaded
django-confidence-0.1.0.tar.gz 4.8 kB Details

Release files / django-confidence-0.1.0.tar.gz

Download URL django-confidence-0.1.0.tar.gz
Size 4.8 kB
Tags Source
SHA-256 checksum
How to use checksums
d36398e26036dfb0dad296df4d4325cc14c464133c90f32ac538f6134a92b94c
BLAKE2b-256 checksum
How to use checksums
6c965e094ae6e4e0dc0e7210d808a4fe05fcd7348051ce975c242da6e742935a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

This release

0.1.0 This release

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page