Metadata-Version: 2.4
Name: django-settings2
Version: 1.0.0
Summary: A simple Django app to store and retrieve application settings in the database
Author-email: Hiep Ho Minh <hiephm@gmail.com>
License: MIT License
        
        Copyright (c) 2026 Hiep Ho Minh
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
        
Project-URL: Homepage, https://github.com/hiephm/django-settings2
Project-URL: Issues, https://github.com/hiephm/django-settings2/issues
Keywords: django,settings,configuration,database
Classifier: Development Status :: 5 - Production/Stable
Classifier: Environment :: Web Environment
Classifier: Framework :: Django
Classifier: Framework :: Django :: 3.2
Classifier: Framework :: Django :: 4.0
Classifier: Framework :: Django :: 4.1
Classifier: Framework :: Django :: 4.2
Classifier: Framework :: Django :: 5.0
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.6
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Internet :: WWW/HTTP
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Requires-Python: >=3.6
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: Django>=3.2
Dynamic: license-file

# django-settings2

A simple Django app to store and retrieve application settings in the database.

## Requirements

- Python >= 3.6
- Django >= 3.2

## Installation

```bash
pip install django-settings2
```

## Configuration

### Add to `INSTALLED_APPS`

```python
INSTALLED_APPS = [
    ...
    "django_settings2",
]
```

### Run migrations

```bash
python manage.py migrate
```

## Usage

```python
from django_settings2.models import DjangoSettings

# Store a value
DjangoSettings.set_value("my_key", "hello")
DjangoSettings.set_value("max_retries", 5, cls=int)
DjangoSettings.set_value("threshold", 0.75, cls=float)

# Retrieve a value
value = DjangoSettings.get_value("my_key", default="fallback")

# Retrieve a JSON value stored as text
data = DjangoSettings.get_value_json("my_json_key", default={})

# Retrieve with row-level lock (useful in transactions)
data = DjangoSettings.get_value_json("my_json_key", lock=True)
```

## License

MIT
