No description
Find a file
2025-03-19 20:20:08 +00:00
.forgejo/workflows chore(deps): update node.js to v22 2025-03-19 20:16:55 +00:00
dbsettings feat: Add description field 2025-03-19 20:50:38 +01:00
.gitignore Add migration 0001 2023-06-09 16:15:05 +02:00
LICENSE Preparing for packaging 2020-04-16 09:07:23 +02:00
MANIFEST.in Preparing for packaging 2020-04-16 09:07:23 +02:00
pyproject.toml chore: Replace setup.py with pyproject.toml 2025-03-19 20:50:20 +01:00
README.md Fix README 2021-02-12 13:31:44 +00:00
renovate.json Add renovate.json 2025-03-06 08:17:19 +00:00

django-dbsettings

dbsettings is a simple reusable Django app allowing you to store key-value pairs in your database, so you can store configuation in your database easily.

Quick start

  1. Add "dbsettings" to your INSTALLED_APPS setting like this:

    INSTALLED_APPS = [
         ...,
         'dbsettings',
     ]
    
  2. Run python manage.py makemigrations dbsettings and python manage.py migrate dbsettings to create the models.

  3. Start the development server and visit http://127.0.0.1:8000/admin/ to add configuration values or use dbsettings.functions.setValue(key, value) in your code.

  4. To retrieve a configuration value from the database, use dbsettings.functions.getValue(key) in your code.

Upgrade notes

When upgrading to 0.9 from a previous version, your database tables will need to be updated. To do this, just execute step 2 from the "Quick start" section again.

When upgrading to 0.9.5 or later from a previous version, you should first uninstall the old version. To do that, run:

pip uninstall django-dbsettings
pip install dbsettings