Skip to main content

A Django app to manage project configuration files.

Project description

=====
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!

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

django-confidence-0.1.0.tar.gz (4.8 kB view details)

Uploaded Source

File details

Details for the file django-confidence-0.1.0.tar.gz.

File metadata

File hashes

Hashes for django-confidence-0.1.0.tar.gz
Algorithm Hash digest
SHA256 d36398e26036dfb0dad296df4d4325cc14c464133c90f32ac538f6134a92b94c
MD5 5274e6182ac901159a570488be2f1aca
BLAKE2b-256 6c965e094ae6e4e0dc0e7210d808a4fe05fcd7348051ce975c242da6e742935a

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page