Customization Guide¶
This guide explains how to customize the Kompass application using configuration files and templates.
Configuration Files¶
The application uses two main configuration files:
settings.toml: Contains core application settingstext.toml: Contains customizable text content
An example settings.toml can be found in deploy/config/settings.toml. For more details, see the following section. settings.toml ~~~~~~~~~~~~
The settings.toml file contains all core configuration settings organized in sections:
[section]
name = "Your Section Name"
street = "Street Address"
town = "12345 Town"
# ... other section details
[LJP]
contribution_per_day = 25
tax = 0.1
[finance]
allowance_per_day = 22
max_night_cost = 11
Key sections include:
[section]: Organization details[LJP]: Youth leadership program settings[finance]: Financial configurations[misc]: Miscellaneous application settings[mail]: Email configuration[database]: Database connection details[custom_model_fields]: Customize visible model fields in admin interface (see below)
Customizing Model Fields¶
The [custom_model_fields] section in settings.toml allows you to customize which fields are visible in the admin interface:
[custom_model_fields]
# Format: applabel_modelname.fields = ['field1', 'field2']
# applabel_modelname.exclude = ['field3', 'field4']
# Example: Show only specific fields
members_emergencycontact.fields = ['prename', 'lastname', 'phone_number']
# Example: Exclude specific fields
members_member.exclude = ['ticket_no', 'dav_badge_no']
There are two ways to customize fields:
Using
fields: Explicitly specify which fields should be shown - Only listed fields will be visible - Overrides any existing field configuration - Order of fields is preserved as specifiedUsing
exclude: Specify which fields should be hidden - All fields except the listed ones will be visible - Adds to any existing exclusions - Original field order is maintained
- Field customization applies to:
Django admin views
Admin forms
Model admin fieldsets
Bemerkung
Custom forms must be modified manually as they are not affected by this configuration.
Text Content¶
The text.toml file allows customization of application text content:
[emails]
welcome_subject = "Welcome to {section_name}"
welcome_body = """
Dear {name},
Welcome to our organization...
"""
[messages]
success_registration = "Registration successful!"
Templates¶
Template Customization¶
You can override any template by placing a custom version in your project’s templates directory:
Create a directory structure matching the original template path
Place your custom template file with the same name
Django will use your custom template instead of the default
Example directory structure:
templates/
└── members/
└── registration_form.tex
└── startpage/
└── contact.html
└── impressum_content.html