Metadata-Version: 2.5
Name: django-siteprefs
Version: 1.3.0
Summary: Reusable app for Django introducing site preferences system
Project-URL: Homepage, https://github.com/idlesign/django-siteprefs
Project-URL: Documentation, https://django-siteprefs.readthedocs.io/
Author-email: Igor Starikov <idlesign@yandex.ru>
License-Expression: BSD-3-Clause
License-File: LICENSE
Keywords: Django,preferences,settings
Classifier: Development Status :: 5 - Production/Stable
Classifier: Environment :: Web Environment
Classifier: Framework :: Django
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: BSD License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Requires-Python: >=3.10
Requires-Dist: django-etc>=1.2.0
Description-Content-Type: text/markdown

# django-siteprefs

<https://github.com/idlesign/django-siteprefs>

[![release](https://img.shields.io/pypi/v/django-siteprefs.svg)](https://pypi.python.org/pypi/django-siteprefs)
[![lic](https://img.shields.io/pypi/l/django-siteprefs.svg)](https://pypi.python.org/pypi/django-siteprefs)
[![coverage](https://img.shields.io/coveralls/idlesign/django-siteprefs/master.svg)](https://coveralls.io/r/idlesign/django-siteprefs)

## What's that

*django-siteprefs allows Django applications settings to come alive*

Let's suppose you have your pretty settings.py file with you application:

```python
from django.conf import settings

MY_OPTION_1 = getattr(settings, 'MY_APP_MY_OPTION_1', True)
MY_OPTION_2 = getattr(settings, 'MY_APP_MY_OPTION_2', 'Some value')
MY_OPTION_42 = getattr(settings, 'MY_APP_MY_OPTION_42', 42)
```

Now you want these options to be exposed to Django Admin interface. Just add the following:

```python
# To be sure our app is still functional without django-siteprefs.
if 'siteprefs' in settings.INSTALLED_APPS:

    from siteprefs.toolbox import preferences

    with preferences() as prefs:
        # And that's how we expose our options to Admin.
        prefs(MY_OPTION_1, MY_OPTION_2, MY_OPTION_42)
```

After that you can view your settings in Django Admin.

If you want those settings to be editable through the Admin — `siteprefs` allows that too, and even more.

Read the docs ;)

## Documentation

<https://django-siteprefs.readthedocs.io/>
