Skip to main content

A collection of features used in our Django-based web applications.

Project description

django-features

A collection of fearures used in our Django-based web applications

Changelog

Installation

pip install ftw-django-features

Usage

Add desired app to INSTALLED_APPS in your Django project.

Available apps:

django_features.system_message
django_features.custom_fields

Configuration

If you want to use django_features, your base configuration class should inherit from django_features.settings.BaseConfiguration.

from django_features.settings import BaseConfiguration


class Base(BaseConfiguration):
    ...

Custom Fields

To use all features of the django_features.custom_fields app, the following steps are required:

Add the django_features.custom_fields.routers.custom_field_router to your ROOT_URLCONF. For example:

path("api/", include(custom_field_router.urls)),

Create your own custom field and value models

  1. You need to create a custom field model and a custom value model.
  2. Your custom field model should inherit from django_features.custom_fields.models.field.AbstractBaseCustomField.
  3. Your custom value model should inherit from django_features.custom_fields.models.value.AbstractBaseCustomValue.

Configuration

  • You can configure the models used by the django_features.custom_fields app by setting the CUSTOM_FIELD_MODEL or CUSTOM_FIELD_VALUE_MODEL setting.
  • The swapped models should inherit from django_features.custom_fields.models.field.AbstractBaseCustomField or django_features.custom_fields.models.value.AbstractBaseCustomValue.

Models with custom values

  1. Your models with custom values should inherit from django_features.custom_fields.models.CustomFieldBaseModel.
  2. Your models should have a relation to the custom value model. For example:
    • custom_values = models.ManyToManyField(blank=True, to=CustomValue, verbose_name=_("Benutzerdefinierte Werte"))

Querysets

Your querysets for the models with custom values should inherit from django_features.custom_fields.models.CustomFieldModelBaseManager.

Serializers

Your serializers for the models with custom values should inherit from django_features.custom_fields.serializers.CustomFieldBaseModelSerializer.

System Message

If you want to use django_features.system_message, your base configuration class should inherit from django_features.system_message.settings.SystemMessageConfigurationMixin.

Then call the super property:

@property
def CONSTANCE_CONFIG(self) -> dict:
    config = super().CONSTANCE_CONFIG
    return {**config, ...}

@property
def CONSTANCE_CONFIG_FIELDSETS(self) -> dict:
    config = super().CONSTANCE_CONFIG_FIELDSETS
    return {
        **config,
        ...
    }

Add the django_features.system_message.routers.system_message_router to your ROOT_URLCONF. For example:

path("api/", include(system_message_router.urls)),

Development

Installing dependencies, assuming you have poetry installed:

poetry install

Release

This package uses towncrier to manage the changelog, and to introduce new changes, a file with a concise title and a brief explanation of what the change accomplishes should be created in the changes directory, with a suffix indicating whether the change is a feature, bugfix, or other.

To make a release and publish it to PyPI, the following command can be executed:

./bin/release

This script utilizes zest.releaser and towncrier to create the release, build the wheel, and publish it to PyPI.

Before running the release command, it is necessary to configure poetry with an access token for PyPI by executing the following command and inserting the token stored in 1password:

poetry config pypi-token.pypi <token>

The version attribute in the pyproject.toml file should be updated to the new version before running the release command, because this version will be published to PyPI.

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

ftw_django_features-2026.3.0.tar.gz (24.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ftw_django_features-2026.3.0-py3-none-any.whl (42.3 kB view details)

Uploaded Python 3

File details

Details for the file ftw_django_features-2026.3.0.tar.gz.

File metadata

  • Download URL: ftw_django_features-2026.3.0.tar.gz
  • Upload date:
  • Size: 24.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.4 CPython/3.13.7 Darwin/24.6.0

File hashes

Hashes for ftw_django_features-2026.3.0.tar.gz
Algorithm Hash digest
SHA256 4685f266bf7d146035d089aa5a2df486acf390b732f0abfd6c408d5cef4be42b
MD5 c9494f69b02858fd0713938c984c0815
BLAKE2b-256 ab943d230311c65dc4dab15ba1c200874f300597b9090bc1197ed5b12aae3749

See more details on using hashes here.

File details

Details for the file ftw_django_features-2026.3.0-py3-none-any.whl.

File metadata

File hashes

Hashes for ftw_django_features-2026.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 794b5f6b4ec2bb3a7642280e665c3f33efdb733f7404e726ac8bd9ec1813e8df
MD5 5a9d8b5af6d70460b2e16bad9903cc2e
BLAKE2b-256 05f1c2650c00300b5abb47faa01b7651df4f672d3163cb8115813b7eff2c3630

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