Skip to main content

DCS - the most advanced admin editable setting

Project description

Django Content Settings - the most advanced admin editable setting

The django-content-settings module is a versatile addition to the Django ecosystem, offering users the ability to easily create and manage editable variables directly from the Django admin panel. What sets this module apart is its ability to handle variables of any type without restricting their complexity. Thanks to an integrated caching system, these variables can be used efficiently in code, irrespective of their complexity.

Key Features

  1. Type-Agnostic Variable Creation: Users can create variables of any type, making the module highly adaptable to various needs.
  2. Editability from Django Admin Panel: Seamless integration with the Django admin panel allows for effortless editing of variables.
  3. Flexible permission model: Every setting can have its own permission rule for viewing, editing, fetching in API, and viewing changes history.
  4. Preview: Preview the setting before applying and the option to preview the setting changes right on site.
  5. Caching System: Ensures high performance, negating the impact of variable complexity on code execution speed.
  6. Export & Import: Massively dump configuration into a file and massively load configuration from the file using UI or/and commands.

Additional Admin Panel Functionalities

  • Change History: Track and review the history of changes made to the variables.
  • Preview System: Preview changes for different variable types before finalizing them.
  • Bulk Editing: Facilitate the simultaneous editing of multiple variable types.
  • Permission System: Control edit permissions for enhanced security and management.
  • Tags Navigation: Every setting has a set of tags, which allows you to organize flexible navigation even with 1000 settings in the system.

For the full documentation, please visit here.

How does it look

  • Setup. Here you can get step-by-step instruction.

  • Define the setting. To do so you need to define constant in content_settings.py in your app

# content_settings.py

from content_settings.types.basic import SimpleString

TITLE = SimpleString("Songs", help="The title of the site")

the code above defines a variable TITLE, with type SimpleString and default value Songs.

  • Migrate. In order to be able to edit data in Django Admin
$ python manage.py migrate

Technically, you can use variable in code even without migration. The migration is need to make variable editable in admin panel

  • Use it in your project. That is it. You can the variable TITLE in your code.
from content_settings.conf import content_settings

content_settings.TITLE

In template:

<h2>{{CONTENT_SETTINGS.TITLE}}</h2>

Quick Look

You should be able to quickly see how it works using cs_test project in the repository. You need to have poetry installed.

$ git clone https://github.com/occipital/django-content-settings.git
$ cd django-content-settings
$ make init
$ make cs-test-migrate
$ make cs-test

the open http://localhost:8000/admin/ in your browser and you should see the django admin panel.

the admin user is admin with password 1.

Whats next?

  • Getting Started - this is a step-by-step guide to configure content settings in your project and add your first setting.
  • Setting Types and Attributes - the guide of all available types and attributes, including some examples.
  • Template Types - the most powerful part of content settings - Templates. Where setting raw value is a text, but setting value is a function.
  • Using Settings - multiple ways to access content settings in your project.
  • Permissions - different settings can have different permissions for different settings' functionality.
  • Defaults Context - allows you to group settings with common parameters, reducing redundancy and making your code cleaner and more maintainable.
  • API & Views - how to organize access to content settings through the API
  • User Interface for Django Admin - the guide is for end users, not only developers. It explains how to use the Django Admin panel for content settings.
  • How Caching is Organized - we want to make sure your content settings work as fast as possible. The guide explains how it is organized and what you can configure.
  • Available Django Settings - reference all available Django settings for content settings.
  • User Defined Settings - experimental functionality - how to give Django Admin users functionality for creation settings right from Django Admin UI.
  • Possible Extensions - wip - all of the ways how you can extend the basic content settings functionality.
  • Cookbook - several simple receipts you can use in your project.
  • Frequently Asked Questions - before asking questions, you might want to visit this section.
  • Glossary - the concept of content settings introduces several new terms, which we collected in this article
  • How to contribute - if you are willing to help - welcome to the team.
  • Changelog - what was introduces in every version.
  • Source Doc - we collect all the doc strings in one article for future reference.

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_content_settings-0.26.tar.gz (63.1 kB view details)

Uploaded Source

Built Distribution

django_content_settings-0.26-py3-none-any.whl (80.9 kB view details)

Uploaded Python 3

File details

Details for the file django_content_settings-0.26.tar.gz.

File metadata

  • Download URL: django_content_settings-0.26.tar.gz
  • Upload date:
  • Size: 63.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.5.0 CPython/3.11.3 Darwin/24.1.0

File hashes

Hashes for django_content_settings-0.26.tar.gz
Algorithm Hash digest
SHA256 e123693aa31aaa3c9286d7ac48cbd4ac6357e624099e9d90c31dc7b09db577b8
MD5 8f228411b6eac9836b35466aea47feb7
BLAKE2b-256 5743c9741d3e1d5bed2610d8a4b83ff2da82efe60747773f52e2d568f99abbfc

See more details on using hashes here.

File details

Details for the file django_content_settings-0.26-py3-none-any.whl.

File metadata

File hashes

Hashes for django_content_settings-0.26-py3-none-any.whl
Algorithm Hash digest
SHA256 896960b2bd73eb4354fbebc8888cac7dea8193a17ed7cf90fb71eb18ded65eeb
MD5 e5c2424c70875273a002495ee21c9a77
BLAKE2b-256 86c25acc1b2291e00ed5064d26b491b55861dbef60ea00487103f3a9f964be6f

See more details on using hashes here.

Supported by

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