django-content-settings


Namedjango-content-settings JSON
Version 0.21 PyPI version JSON
download
home_pagehttps://django-content-settings.readthedocs.io/
SummaryDCS - the most advanced admin editable setting
upload_time2024-08-28 11:48:50
maintainerNone
docs_urlNone
authoroduvan
requires_python>=3.8
licenseMIT
keywords django settings
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # 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](https://django-content-settings.readthedocs.io/).

### How does it look

- **Setup**. [Here](https://django-content-settings.readthedocs.io/en/master/first/) 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

```python
# 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

```bash
$ 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. 

```python

from content_settings.conf import content_settings

content_settings.TITLE
```

In template:

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

### Quick Look

You should be able to quickly see how it works using `cs_test` project in the [repository](https://github.com/occipital/django-content-settings/t). You need to have [poetry](https://python-poetry.org/) installed.

```bash

$ 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**](https://django-content-settings.readthedocs.io/en/master/first/) - this is a step-by-step guide to configure content settings in your project and add your first setting.
- [**Setting Types and Attributes**](https://django-content-settings.readthedocs.io/en/master/types/) - the guide of all available types and attributes, including some examples.
- [**Template Types**](https://django-content-settings.readthedocs.io/en/master/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**](https://django-content-settings.readthedocs.io/en/master/access/) - multiple ways to access content settings in your project.
- [**Permissions**](https://django-content-settings.readthedocs.io/en/master/permissions/) - different settings can have different permissions for different settings' functionality.
- [**Defaults Context**](https://django-content-settings.readthedocs.io/en/master/defaults/) - allows you to group settings with common parameters, reducing redundancy and making your code cleaner and more maintainable.
- [**API & Views**](https://django-content-settings.readthedocs.io/en/master/api/) - how to organize access to content settings through the API
- [**User Interface for Django Admin**](https://django-content-settings.readthedocs.io/en/master/ui/) - 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**](https://django-content-settings.readthedocs.io/en/master/caching/) - 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**](https://django-content-settings.readthedocs.io/en/master/settings/) - reference all available Django settings for content settings.
- [**User Defined Settings**](https://django-content-settings.readthedocs.io/en/master/uservar/) - *experimental functionality* - how to give Django Admin users functionality for creation settings right from Django Admin UI.
- [**Possible Extensions**](https://django-content-settings.readthedocs.io/en/master/extends/) - *wip* - all of the ways how you can extend the basic content settings functionality.
- [**Cookbook**](https://django-content-settings.readthedocs.io/en/master/cookbook/) - several simple receipts you can use in your project.
- [**Frequently Asked Questions**](https://django-content-settings.readthedocs.io/en/master/faq/) - before asking questions, you might want to visit this section.
- [**Glossary**](https://django-content-settings.readthedocs.io/en/master/glossary/) - the concept of content settings introduces several new terms, which we collected in this article
- [**How to contribute**](https://django-content-settings.readthedocs.io/en/master/contribute/) - if you are willing to help - welcome to the team.
- [**Changelog**](https://django-content-settings.readthedocs.io/en/master/changelog/) - what was introduces in every version.
- [**Source Doc**](https://django-content-settings.readthedocs.io/en/master/source/) - we collect all the doc strings in one article for future reference.
            

Raw data

            {
    "_id": null,
    "home_page": "https://django-content-settings.readthedocs.io/",
    "name": "django-content-settings",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.8",
    "maintainer_email": null,
    "keywords": "Django, settings",
    "author": "oduvan",
    "author_email": "a.lyabah@checkio.org",
    "download_url": "https://files.pythonhosted.org/packages/1f/78/d260e4cc3ee14baacfe8376e45d8659279fc474bff2679f8c73690567959/django_content_settings-0.21.tar.gz",
    "platform": null,
    "description": "# Django Content Settings - the most advanced admin editable setting\n\nThe `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.\n\n### Key Features\n\n1. **Type-Agnostic Variable Creation**: Users can create variables of any type, making the module highly adaptable to various needs.\n2. **Editability from Django Admin Panel**: Seamless integration with the Django admin panel allows for effortless editing of variables.\n3. **Flexible permission model**: Every setting can have its own permission rule for viewing, editing, fetching in API, and viewing changes history.\n4. **Preview**: Preview the setting before applying and the option to preview the setting changes right on site.\n5. **Caching System**: Ensures high performance, negating the impact of variable complexity on code execution speed.\n6. **Export & Import**: Massively dump configuration into a file and massively load configuration from the file using UI or/and commands.\n\n### Additional Admin Panel Functionalities\n\n- **Change History**: Track and review the history of changes made to the variables.\n- **Preview System**: Preview changes for different variable types before finalizing them.\n- **Bulk Editing**: Facilitate the simultaneous editing of multiple variable types.\n- **Permission System**: Control edit permissions for enhanced security and management.\n- **Tags Navigation**: Every setting has a set of tags, which allows you to organize flexible navigation even with 1000 settings in the system.\n\nFor the full documentation, please visit [here](https://django-content-settings.readthedocs.io/).\n\n### How does it look\n\n- **Setup**. [Here](https://django-content-settings.readthedocs.io/en/master/first/) you can get step-by-step instruction.\n\n- **Define the setting**. To do so you need to define constant in `content_settings.py` in your app\n\n```python\n# content_settings.py\n\nfrom content_settings.types.basic import SimpleString\n\nTITLE = SimpleString(\"Songs\", help=\"The title of the site\")\n```\n\nthe code above defines a variable `TITLE`, with type `SimpleString` and default value `Songs`.\n\n- **Migrate**. In order to be able to edit data in Django Admin\n\n```bash\n$ python manage.py migrate\n```\n\n_Technically, you can use variable in code even without migration. The migration is need to make variable editable in admin panel_\n\n- **Use it in your project**. That is it. You can the variable `TITLE` in your code. \n\n```python\n\nfrom content_settings.conf import content_settings\n\ncontent_settings.TITLE\n```\n\nIn template:\n\n```html\n<h2>{{CONTENT_SETTINGS.TITLE}}</h2>\n```\n\n### Quick Look\n\nYou should be able to quickly see how it works using `cs_test` project in the [repository](https://github.com/occipital/django-content-settings/t). You need to have [poetry](https://python-poetry.org/) installed.\n\n```bash\n\n$ git clone https://github.com/occipital/django-content-settings.git\n$ cd django-content-settings\n$ make init\n$ make cs-test-migrate\n$ make cs-test\n```\n\nthe open `http://localhost:8000/admin/` in your browser and you should see the django admin panel.\n\nthe admin user is `admin` with password `1`.\n\n# Whats next?\n\n- [**Getting Started**](https://django-content-settings.readthedocs.io/en/master/first/) - this is a step-by-step guide to configure content settings in your project and add your first setting.\n- [**Setting Types and Attributes**](https://django-content-settings.readthedocs.io/en/master/types/) - the guide of all available types and attributes, including some examples.\n- [**Template Types**](https://django-content-settings.readthedocs.io/en/master/template_types/) - the most powerful part of content settings - Templates. Where setting raw value is a text, but setting value is a function.\n- [**Using Settings**](https://django-content-settings.readthedocs.io/en/master/access/) - multiple ways to access content settings in your project.\n- [**Permissions**](https://django-content-settings.readthedocs.io/en/master/permissions/) - different settings can have different permissions for different settings' functionality.\n- [**Defaults Context**](https://django-content-settings.readthedocs.io/en/master/defaults/) - allows you to group settings with common parameters, reducing redundancy and making your code cleaner and more maintainable.\n- [**API & Views**](https://django-content-settings.readthedocs.io/en/master/api/) - how to organize access to content settings through the API\n- [**User Interface for Django Admin**](https://django-content-settings.readthedocs.io/en/master/ui/) - the guide is for end users, not only developers. It explains how to use the Django Admin panel for content settings.\n- [**How Caching is Organized**](https://django-content-settings.readthedocs.io/en/master/caching/) - 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.\n- [**Available Django Settings**](https://django-content-settings.readthedocs.io/en/master/settings/) - reference all available Django settings for content settings.\n- [**User Defined Settings**](https://django-content-settings.readthedocs.io/en/master/uservar/) - *experimental functionality* - how to give Django Admin users functionality for creation settings right from Django Admin UI.\n- [**Possible Extensions**](https://django-content-settings.readthedocs.io/en/master/extends/) - *wip* - all of the ways how you can extend the basic content settings functionality.\n- [**Cookbook**](https://django-content-settings.readthedocs.io/en/master/cookbook/) - several simple receipts you can use in your project.\n- [**Frequently Asked Questions**](https://django-content-settings.readthedocs.io/en/master/faq/) - before asking questions, you might want to visit this section.\n- [**Glossary**](https://django-content-settings.readthedocs.io/en/master/glossary/) - the concept of content settings introduces several new terms, which we collected in this article\n- [**How to contribute**](https://django-content-settings.readthedocs.io/en/master/contribute/) - if you are willing to help - welcome to the team.\n- [**Changelog**](https://django-content-settings.readthedocs.io/en/master/changelog/) - what was introduces in every version.\n- [**Source Doc**](https://django-content-settings.readthedocs.io/en/master/source/) - we collect all the doc strings in one article for future reference.",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "DCS - the most advanced admin editable setting",
    "version": "0.21",
    "project_urls": {
        "Homepage": "https://django-content-settings.readthedocs.io/",
        "Repository": "https://github.com/occipital/django-content-settings/"
    },
    "split_keywords": [
        "django",
        " settings"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "cc613ee6a179ffe7ef8472bfdf329bb26ceea24f02790d428a6044b385c93cf8",
                "md5": "18fd91ed03d7f3498f8f75cf3172714f",
                "sha256": "572c30be83e0116f8a2164ab238a32f5b8a52dd663a2ab91f081cae22bb31aa5"
            },
            "downloads": -1,
            "filename": "django_content_settings-0.21-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "18fd91ed03d7f3498f8f75cf3172714f",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8",
            "size": 79793,
            "upload_time": "2024-08-28T11:48:43",
            "upload_time_iso_8601": "2024-08-28T11:48:43.160563Z",
            "url": "https://files.pythonhosted.org/packages/cc/61/3ee6a179ffe7ef8472bfdf329bb26ceea24f02790d428a6044b385c93cf8/django_content_settings-0.21-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "1f78d260e4cc3ee14baacfe8376e45d8659279fc474bff2679f8c73690567959",
                "md5": "861c56907dcd3846256025979e8b408d",
                "sha256": "b7a9af96cdf6ed4d747728fe0ab05a8979e4b4699caa6141a65f316aea34b0e6"
            },
            "downloads": -1,
            "filename": "django_content_settings-0.21.tar.gz",
            "has_sig": false,
            "md5_digest": "861c56907dcd3846256025979e8b408d",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 62866,
            "upload_time": "2024-08-28T11:48:50",
            "upload_time_iso_8601": "2024-08-28T11:48:50.321091Z",
            "url": "https://files.pythonhosted.org/packages/1f/78/d260e4cc3ee14baacfe8376e45d8659279fc474bff2679f8c73690567959/django_content_settings-0.21.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-08-28 11:48:50",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "occipital",
    "github_project": "django-content-settings",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "django-content-settings"
}
        
Elapsed time: 2.02803s