django-settings-inspector


Namedjango-settings-inspector JSON
Version 1.0.5 PyPI version JSON
download
home_pagehttps://github.com/cumulus13/django-settings-inspector
SummaryA Django management and CLI tool to inspect and colorize project settings
upload_time2025-10-07 18:27:08
maintainerNone
docs_urlNone
authorHadi Cahyadi
requires_pythonNone
licenseMIT
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # 🧭 Django Settings Inspector

**Django Settings Inspector** is a developer tool that extends Django’s built-in management commands to **inspect and visualize project configuration** in a structured and colorized format.

It helps you quickly understand, debug, and document your Django settings β€” whether you are auditing security, reviewing deployments, or checking environment consistency.

[![PyPI version](https://img.shields.io/pypi/v/django-settings-inspector.svg?color=blue&logo=pypi)](https://pypi.org/project/django-settings-inspector/)
[![Python Versions](https://img.shields.io/pypi/pyversions/django-settings-inspector.svg?logo=python)](https://pypi.org/project/django-settings-inspector/)
[![License](https://img.shields.io/github/license/cumulus13/django-settings-inspector?color=green)](https://github.com/cumulus13/django-settings-inspector/blob/main/LICENSE)
[![Downloads](https://static.pepy.tech/badge/django-settings-inspector)](https://pepy.tech/project/django-settings-inspector)

---

## ✨ Features

* πŸ” Inspect all Django configuration categories
* 🎨 Beautiful color output using [Rich](https://github.com/Textualize/rich)
* 🧩 Works as standard Django management commands
* 🧰 Includes standalone CLI (`djinspect`) for quick inspection
* βš™οΈ Optional `--filter` keyword to narrow results (on `all` command)
* πŸ§ͺ Fully testable with `pytest`
* πŸ’‘ No side effects β€” purely read-only and safe

---

## πŸ“¦ Installation

From **PyPI**:

```bash
pip install django-settings-inspector
```

From **source** (for development):

```bash
git clone https://github.com/cumulus13/django-settings-inspector.git
cd django-settings-inspector
pip install -e .
```

## βš™οΈ Setup

Add `django_settings_inspector` to your Django project’s `INSTALLED_APPS`:

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

That’s it! You can now run any of the new management commands:

```bash
python manage.py all
```

Or use the standalone CLI:

```bash
djinspect all
```

## βš™οΈ Usage

### 1️⃣ Import in your Django project

Instead of a giant `settings.py`, you can modularize it:

```python
# settings.py
from django_settings_inspector.management.commands.core import *
from django_settings_inspector.management.commands.db import *
from django_settings_inspector.management.commands.cache import *
from django_settings_inspector.management.commands.logging import *
from django_settings_inspector.management.commands.security import *
```

Or load all in one line:

```python
from django_settings_inspector.management.commands.all import *
```

---

### 2️⃣ Use the CLI inspector

List all detected settings:

```bash
django-settings-inspector all
```

Filter by keyword:

```bash
django-settings-inspector all --filter DATABASE
```

Example Output:

```
DATABASES:
  default:
    ENGINE: django.db.backends.sqlite3
    NAME: db.sqlite3

CACHES:
  default:
    BACKEND: django.core.cache.backends.locmem.LocMemCache
```

---

### 3️⃣ Django management command

You can run it as a Django command too:

```bash
python manage.py all
```

With filters:

```bash
python manage.py all --filter TIME_ZONE
```

---

## 🧠 Example Workflow

Here’s how you might use it in a real-world Django project:

```bash
# Create new Django project
django-admin startproject myproject

# Optionally import Django Settings Inspector for exploration
cd myproject
echo "from django_settings_inspector.management.commands.all import *" >> settings.py

# Keep your existing settings below (do not remove SECRET_KEY or BASE_DIR)

# Run server
python manage.py runserver
```

And you’ll instantly have access to all modularized settings and their management commands.

---

## 🎨 Example Output

When `rich` is installed:

```bash
python manage.py static
```

Produces:

```
┏━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
┃ Setting            ┃ Value                                                       ┃
┑━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┩
β”‚ STATIC_URL         β”‚ /static/                                                    β”‚
β”‚ STATIC_ROOT        β”‚ BASE_DIR / "staticfiles"                                    β”‚
β”‚ STATICFILES_DIRS   β”‚ ['assets', 'frontend/static']                               β”‚
β”‚ STATICFILES_STORAGEβ”‚ 'django.contrib.staticfiles.storage.StaticFilesStorage'     β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
```

---

## 🧰 CLI Options

| Command        | Description                                                                 |
| -------------- | --------------------------------------------------------------------------- |
| `all`          | Show all grouped settings; supports `--filter <keyword>`                    |
| `auth`         | Authentication-related settings                                             |
| `cache`        | Caching configuration                                                       |
| `core`         | Core environment & global options (`BASE_DIR`, `DEBUG`, `SECRET_KEY`, etc.) |
| `db`           | Database configuration                                                      |
| `diffsettings` | Colorized diff between Django defaults and current settings                 |
| `email`        | Email backend and related configs                                           |
| `installed`    | Installed apps and related settings                                         |
| `locale`       | Language and timezone settings                                              |
| `logging`      | Logging configuration                                                       |
| `media`        | Media and upload file settings                                              |
| `middleware`   | Middleware stack                                                            |
| `security`     | Security and HTTPS-related settings                                         |
| `session`      | Session configuration                                                       |
| `site`         | Site and root application settings                                          |
| `static`       | Static files settings                                                       |
| `storage`      | File storage and upload settings                                            |
| `template`     | Template engine settings                                                    |
| `validator`    | Validation & password policy settings                                       |

### 🧩 Available Commands (run with django-admin)

| Command                   | Description                          |
| ------------------------- | ------------------------------------ |
| `djinspect/manage all`        | Show all settings (merged view)      |
| `djinspect/manage core`       | Show core Django settings            |
| `djinspect/manage db`         | Show database-related settings       |
| `djinspect/manage auth`       | Show authentication settings         |
| `djinspect/manage cache`      | Show cache settings                  |
| `djinspect/manage logging`    | Show logging configuration           |
| `djinspect/manage security`   | Show security settings               |
| `djinspect/manage email`      | Show email settings                  |
| `djinspect/manage session`    | Show session settings                |
| `djinspect/manage site`       | Show site-related settings           |
| `djinspect/manage static`     | Show static file configuration       |
| `djinspect/manage storage`    | Show media and file storage settings |
| `djinspect/manage template`   | Show template settings               |
| `djinspect/manage locale`     | Show i18n/l10n and timezone settings |
| `djinspect/manage installed`  | List installed apps                  |
| `djinspect/manage middleware` | List middleware components           |
| `djinspect/manage validator`  | Validate settings consistency        |

---

## 🧰 CLI & Management Commands 

This package exposes a set of Django management commands (usable with `python manage.py <command>`) and a small standalone CLI (`djinspect`) that currently wraps the `all` command.

> Note: `python manage.py <command>` works inside any Django project that has `django_settings_inspector` installed and added to `INSTALLED_APPS`.
> `djinspect` is a lightweight CLI shipped with the package β€” at present it supports the `all` command. If you want it to proxy all commands, tell me and I’ll add it.

### Global options

* `-h`, `--help` β€” show help for a command.
* `--filter <keyword>` (or `-f <keyword>`) β€” **only supported by `all`**; case-insensitive keyword filter for the aggregated output.

---

### All commands (management commands included in the package)

Use `python manage.py <command>` (examples below). All commands print human-readable configuration; if `rich` is installed they will print a colored table/syntax-highlighted block.

* `all`
  Show grouped settings for many categories (Database, Cache, Static, Media, Auth, Security, Email, etc.).
  Example:

  ```bash
  python manage.py all
  python manage.py all --filter cache      # only sections/keys matching "cache"
  djinspect all --filter email            # CLI wrapper for 'all' (djinspect supports 'all')
  ```

* `auth`
  Show authentication-related settings (`AUTH_USER_MODEL`, `AUTHENTICATION_BACKENDS`, login/logout URLs, password hashers, session auth-related keys).
  Example:

  ```bash
  python manage.py auth
  ```

* `cache`
  Show cache configuration (`CACHES`, `CACHE_MIDDLEWARE_*`, cacheops settings if present, `USE_ETAGS`, etc.).
  Example:

  ```bash
  python manage.py cache
  ```

* `core`
  Show core environment and security basics (`BASE_DIR`, `DEBUG`, masked `SECRET_KEY`, `ALLOWED_HOSTS`).
  Example:

  ```bash
  python manage.py core
  ```

* `db`
  Show database-related settings (`DATABASES`, `DEFAULT_AUTO_FIELD`).
  Example:

  ```bash
  python manage.py db
  ```

* `diffsettings`
  Display the difference between project settings and Django defaults (similar to Django’s built-in `diffsettings`, but colorized if Rich is available).
  Example:

  ```bash
  python manage.py diffsettings
  ```

* `email`
  Show email configuration (`EMAIL_BACKEND`, `EMAIL_HOST`, `EMAIL_PORT`, `DEFAULT_FROM_EMAIL`, `ADMINS`, etc.).
  Example:

  ```bash
  python manage.py email
  ```

* `installed`
  Show `INSTALLED_APPS` and related app-level settings (e.g. `DEFAULT_AUTO_FIELD`, `MIGRATION_MODULES`).
  Example:

  ```bash
  python manage.py installed
  ```

* `locale`
  Show internationalization and timezone settings (`LANGUAGE_CODE`, `TIME_ZONE`, `USE_I18N`, `USE_TZ`).
  Example:

  ```bash
  python manage.py locale
  ```

* `logging`
  Show logging configuration (`LOGGING`, `LOGGING_CONFIG`, `DEFAULT_LOGGING`, etc.).
  Example:

  ```bash
  python manage.py logging
  ```

* `media`
  Show media/file upload settings (`MEDIA_URL`, `MEDIA_ROOT`, `DEFAULT_FILE_STORAGE`, and common cloud-storage vars if present).
  Example:

  ```bash
  python manage.py media
  ```

* `middleware`
  Show middleware stack plus related flags (`MIDDLEWARE`, `MIDDLEWARE_CLASSES`, `SECURE_*`, `CSRF_*`, `SESSION_*`, CORS settings if present).
  Example:

  ```bash
  python manage.py middleware
  ```

* `security`
  Show security & HTTPS-related settings (`CSRF_COOKIE_SECURE`, `SESSION_COOKIE_SECURE`, `SECURE_SSL_REDIRECT`, HSTS settings, `X_FRAME_OPTIONS`, etc.).
  Example:

  ```bash
  python manage.py security
  ```

* `session`
  Show session-specific configuration (`SESSION_ENGINE`, cookie names, age, `SESSION_SAVE_EVERY_REQUEST`, `SESSION_FILE_PATH`, etc.).
  Example:

  ```bash
  python manage.py session
  ```

* `site`
  Site and environment-level settings (`BASE_DIR`, `ROOT_URLCONF`, `WSGI_APPLICATION`, `ASGI_APPLICATION`, `ALLOWED_HOSTS`, `SITE_ID`, etc.).
  Example:

  ```bash
  python manage.py site
  ```

* `static`
  Show static files settings (`STATIC_URL`, `STATICFILES_DIRS`, `STATIC_ROOT`, `STATICFILES_STORAGE`, `STATICFILES_FINDERS`, WhiteNoise options if present).
  Example:

  ```bash
  python manage.py static
  ```

* `storage`
  Show storage-related settings (`DEFAULT_FILE_STORAGE`, `STORAGES`, upload limits and permissions, `DATA_UPLOAD_MAX_MEMORY_SIZE`, etc.).
  Example:

  ```bash
  python manage.py storage
  ```

* `template`
  Show template engine settings (`TEMPLATES`, `TEMPLATE_DIRS`, `OPTIONS` context processors/loaders/jinja options).
  Example:

  ```bash
  python manage.py template
  ```

* `validator`
  Show validation and password-related settings (`AUTH_PASSWORD_VALIDATORS`, `PASSWORD_HASHERS`, `PASSWORD_RESET_TIMEOUT`, etc.) and related auth redirect urls.
  Example:

  ```bash
  python manage.py validator
  ```

---

### Example: colorized output (when `rich` installed)

```bash
python manage.py static
# prints a colored table with STATIC_URL, STATIC_ROOT, STATICFILES_DIRS, etc.
```

---

### Notes & Tips

* `djinspect` CLI is provided as a convenience and currently runs the `all` command:

  ```bash
  djinspect all --filter cache
  ```
---

## πŸ§ͺ Tests (pytest)

```
tests/
β”œβ”€β”€ __init__.py
β”œβ”€β”€ conftest.py
β”œβ”€β”€ test_core_commands.py
└── test_cli.py
```

### Example `test_cli.py`

```python
import subprocess
import sys

def test_cli_all_command():
    result = subprocess.run(
        [sys.executable, "-m", "django_settings_inspector.cli", "--filter", "DATABASE"],
        capture_output=True,
        text=True
    )
    assert "DATABASES" in result.stdout

def test_import_all():
    import django_settings_inspector.management.commands.all as allmod
    assert hasattr(allmod, "BASE_DIR")
```

### Example test file: `tests/test_core_commands.py`

```python
import pytest
from django.core.management import call_command

@pytest.mark.django_db
def test_all_command_runs_safely(settings):
    """Ensure 'all' command runs without error."""
    call_command("all")

def test_specific_command_outputs(settings, capsys):
    """Check output contains key variables."""
    call_command("core")
    captured = capsys.readouterr()
    assert "BASE_DIR" in captured.out
```

Run tests:

```bash
pytest -v
```
---

## πŸ’‘ Tips for Development

* Use `pip install -e .` during development
* Use `python -m django_settings_inspector.cli` to test CLI
* To publish to PyPI:

## πŸ§‘β€πŸ’» Contributing

1. Fork the repository
2. Create a new branch (`git checkout -b feature/my-feature`)
3. Commit changes (`git commit -am 'Add my feature'`)
4. Push to your branch (`git push origin feature/my-feature`)
5. Open a Pull Request

---

## βš–οΈ License

This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.

MIT Β© 2025 [Hadi Cahyadi](mailto:cumulus13@gmail.com)

## author
[Hadi Cahyadi](mailto:cumulus13@gmail.com)
    

[![Buy Me a Coffee](https://www.buymeacoffee.com/assets/img/custom_images/orange_img.png)](https://www.buymeacoffee.com/cumulus13)

[![Donate via Ko-fi](https://ko-fi.com/img/githubbutton_sm.svg)](https://ko-fi.com/cumulus13)
 
[Support me on Patreon](https://www.patreon.com/cumulus13)

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/cumulus13/django-settings-inspector",
    "name": "django-settings-inspector",
    "maintainer": null,
    "docs_url": null,
    "requires_python": null,
    "maintainer_email": null,
    "keywords": null,
    "author": "Hadi Cahyadi",
    "author_email": "cumulus13@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/8a/08/c4b346209d1da41862bd09e00ff33ac78fb9b92212b371744a914ec78cc8/django_settings_inspector-1.0.5.tar.gz",
    "platform": null,
    "description": "# \ud83e\udded Django Settings Inspector\r\n\r\n**Django Settings Inspector** is a developer tool that extends Django\u2019s built-in management commands to **inspect and visualize project configuration** in a structured and colorized format.\r\n\r\nIt helps you quickly understand, debug, and document your Django settings \u2014 whether you are auditing security, reviewing deployments, or checking environment consistency.\r\n\r\n[![PyPI version](https://img.shields.io/pypi/v/django-settings-inspector.svg?color=blue&logo=pypi)](https://pypi.org/project/django-settings-inspector/)\r\n[![Python Versions](https://img.shields.io/pypi/pyversions/django-settings-inspector.svg?logo=python)](https://pypi.org/project/django-settings-inspector/)\r\n[![License](https://img.shields.io/github/license/cumulus13/django-settings-inspector?color=green)](https://github.com/cumulus13/django-settings-inspector/blob/main/LICENSE)\r\n[![Downloads](https://static.pepy.tech/badge/django-settings-inspector)](https://pepy.tech/project/django-settings-inspector)\r\n\r\n---\r\n\r\n## \u2728 Features\r\n\r\n* \ud83d\udd0d Inspect all Django configuration categories\r\n* \ud83c\udfa8 Beautiful color output using [Rich](https://github.com/Textualize/rich)\r\n* \ud83e\udde9 Works as standard Django management commands\r\n* \ud83e\uddf0 Includes standalone CLI (`djinspect`) for quick inspection\r\n* \u2699\ufe0f Optional `--filter` keyword to narrow results (on `all` command)\r\n* \ud83e\uddea Fully testable with `pytest`\r\n* \ud83d\udca1 No side effects \u2014 purely read-only and safe\r\n\r\n---\r\n\r\n## \ud83d\udce6 Installation\r\n\r\nFrom **PyPI**:\r\n\r\n```bash\r\npip install django-settings-inspector\r\n```\r\n\r\nFrom **source** (for development):\r\n\r\n```bash\r\ngit clone https://github.com/cumulus13/django-settings-inspector.git\r\ncd django-settings-inspector\r\npip install -e .\r\n```\r\n\r\n## \u2699\ufe0f Setup\r\n\r\nAdd `django_settings_inspector` to your Django project\u2019s `INSTALLED_APPS`:\r\n\r\n```python\r\nINSTALLED_APPS = [\r\n    ...\r\n    \"django_settings_inspector\",\r\n]\r\n```\r\n\r\nThat\u2019s it! You can now run any of the new management commands:\r\n\r\n```bash\r\npython manage.py all\r\n```\r\n\r\nOr use the standalone CLI:\r\n\r\n```bash\r\ndjinspect all\r\n```\r\n\r\n## \u2699\ufe0f Usage\r\n\r\n### 1\ufe0f\u20e3 Import in your Django project\r\n\r\nInstead of a giant `settings.py`, you can modularize it:\r\n\r\n```python\r\n# settings.py\r\nfrom django_settings_inspector.management.commands.core import *\r\nfrom django_settings_inspector.management.commands.db import *\r\nfrom django_settings_inspector.management.commands.cache import *\r\nfrom django_settings_inspector.management.commands.logging import *\r\nfrom django_settings_inspector.management.commands.security import *\r\n```\r\n\r\nOr load all in one line:\r\n\r\n```python\r\nfrom django_settings_inspector.management.commands.all import *\r\n```\r\n\r\n---\r\n\r\n### 2\ufe0f\u20e3 Use the CLI inspector\r\n\r\nList all detected settings:\r\n\r\n```bash\r\ndjango-settings-inspector all\r\n```\r\n\r\nFilter by keyword:\r\n\r\n```bash\r\ndjango-settings-inspector all --filter DATABASE\r\n```\r\n\r\nExample Output:\r\n\r\n```\r\nDATABASES:\r\n  default:\r\n    ENGINE: django.db.backends.sqlite3\r\n    NAME: db.sqlite3\r\n\r\nCACHES:\r\n  default:\r\n    BACKEND: django.core.cache.backends.locmem.LocMemCache\r\n```\r\n\r\n---\r\n\r\n### 3\ufe0f\u20e3 Django management command\r\n\r\nYou can run it as a Django command too:\r\n\r\n```bash\r\npython manage.py all\r\n```\r\n\r\nWith filters:\r\n\r\n```bash\r\npython manage.py all --filter TIME_ZONE\r\n```\r\n\r\n---\r\n\r\n## \ud83e\udde0 Example Workflow\r\n\r\nHere\u2019s how you might use it in a real-world Django project:\r\n\r\n```bash\r\n# Create new Django project\r\ndjango-admin startproject myproject\r\n\r\n# Optionally import Django Settings Inspector for exploration\r\ncd myproject\r\necho \"from django_settings_inspector.management.commands.all import *\" >> settings.py\r\n\r\n# Keep your existing settings below (do not remove SECRET_KEY or BASE_DIR)\r\n\r\n# Run server\r\npython manage.py runserver\r\n```\r\n\r\nAnd you\u2019ll instantly have access to all modularized settings and their management commands.\r\n\r\n---\r\n\r\n## \ud83c\udfa8 Example Output\r\n\r\nWhen `rich` is installed:\r\n\r\n```bash\r\npython manage.py static\r\n```\r\n\r\nProduces:\r\n\r\n```\r\n\u250f\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2533\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2513\r\n\u2503 Setting            \u2503 Value                                                       \u2503\r\n\u2521\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2547\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2529\r\n\u2502 STATIC_URL         \u2502 /static/                                                    \u2502\r\n\u2502 STATIC_ROOT        \u2502 BASE_DIR / \"staticfiles\"                                    \u2502\r\n\u2502 STATICFILES_DIRS   \u2502 ['assets', 'frontend/static']                               \u2502\r\n\u2502 STATICFILES_STORAGE\u2502 'django.contrib.staticfiles.storage.StaticFilesStorage'     \u2502\r\n\u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518\r\n```\r\n\r\n---\r\n\r\n## \ud83e\uddf0 CLI Options\r\n\r\n| Command        | Description                                                                 |\r\n| -------------- | --------------------------------------------------------------------------- |\r\n| `all`          | Show all grouped settings; supports `--filter <keyword>`                    |\r\n| `auth`         | Authentication-related settings                                             |\r\n| `cache`        | Caching configuration                                                       |\r\n| `core`         | Core environment & global options (`BASE_DIR`, `DEBUG`, `SECRET_KEY`, etc.) |\r\n| `db`           | Database configuration                                                      |\r\n| `diffsettings` | Colorized diff between Django defaults and current settings                 |\r\n| `email`        | Email backend and related configs                                           |\r\n| `installed`    | Installed apps and related settings                                         |\r\n| `locale`       | Language and timezone settings                                              |\r\n| `logging`      | Logging configuration                                                       |\r\n| `media`        | Media and upload file settings                                              |\r\n| `middleware`   | Middleware stack                                                            |\r\n| `security`     | Security and HTTPS-related settings                                         |\r\n| `session`      | Session configuration                                                       |\r\n| `site`         | Site and root application settings                                          |\r\n| `static`       | Static files settings                                                       |\r\n| `storage`      | File storage and upload settings                                            |\r\n| `template`     | Template engine settings                                                    |\r\n| `validator`    | Validation & password policy settings                                       |\r\n\r\n### \ud83e\udde9 Available Commands (run with django-admin)\r\n\r\n| Command                   | Description                          |\r\n| ------------------------- | ------------------------------------ |\r\n| `djinspect/manage all`        | Show all settings (merged view)      |\r\n| `djinspect/manage core`       | Show core Django settings            |\r\n| `djinspect/manage db`         | Show database-related settings       |\r\n| `djinspect/manage auth`       | Show authentication settings         |\r\n| `djinspect/manage cache`      | Show cache settings                  |\r\n| `djinspect/manage logging`    | Show logging configuration           |\r\n| `djinspect/manage security`   | Show security settings               |\r\n| `djinspect/manage email`      | Show email settings                  |\r\n| `djinspect/manage session`    | Show session settings                |\r\n| `djinspect/manage site`       | Show site-related settings           |\r\n| `djinspect/manage static`     | Show static file configuration       |\r\n| `djinspect/manage storage`    | Show media and file storage settings |\r\n| `djinspect/manage template`   | Show template settings               |\r\n| `djinspect/manage locale`     | Show i18n/l10n and timezone settings |\r\n| `djinspect/manage installed`  | List installed apps                  |\r\n| `djinspect/manage middleware` | List middleware components           |\r\n| `djinspect/manage validator`  | Validate settings consistency        |\r\n\r\n---\r\n\r\n## \ud83e\uddf0 CLI & Management Commands \r\n\r\nThis package exposes a set of Django management commands (usable with `python manage.py <command>`) and a small standalone CLI (`djinspect`) that currently wraps the `all` command.\r\n\r\n> Note: `python manage.py <command>` works inside any Django project that has `django_settings_inspector` installed and added to `INSTALLED_APPS`.\r\n> `djinspect` is a lightweight CLI shipped with the package \u2014 at present it supports the `all` command. If you want it to proxy all commands, tell me and I\u2019ll add it.\r\n\r\n### Global options\r\n\r\n* `-h`, `--help` \u2014 show help for a command.\r\n* `--filter <keyword>` (or `-f <keyword>`) \u2014 **only supported by `all`**; case-insensitive keyword filter for the aggregated output.\r\n\r\n---\r\n\r\n### All commands (management commands included in the package)\r\n\r\nUse `python manage.py <command>` (examples below). All commands print human-readable configuration; if `rich` is installed they will print a colored table/syntax-highlighted block.\r\n\r\n* `all`\r\n  Show grouped settings for many categories (Database, Cache, Static, Media, Auth, Security, Email, etc.).\r\n  Example:\r\n\r\n  ```bash\r\n  python manage.py all\r\n  python manage.py all --filter cache      # only sections/keys matching \"cache\"\r\n  djinspect all --filter email            # CLI wrapper for 'all' (djinspect supports 'all')\r\n  ```\r\n\r\n* `auth`\r\n  Show authentication-related settings (`AUTH_USER_MODEL`, `AUTHENTICATION_BACKENDS`, login/logout URLs, password hashers, session auth-related keys).\r\n  Example:\r\n\r\n  ```bash\r\n  python manage.py auth\r\n  ```\r\n\r\n* `cache`\r\n  Show cache configuration (`CACHES`, `CACHE_MIDDLEWARE_*`, cacheops settings if present, `USE_ETAGS`, etc.).\r\n  Example:\r\n\r\n  ```bash\r\n  python manage.py cache\r\n  ```\r\n\r\n* `core`\r\n  Show core environment and security basics (`BASE_DIR`, `DEBUG`, masked `SECRET_KEY`, `ALLOWED_HOSTS`).\r\n  Example:\r\n\r\n  ```bash\r\n  python manage.py core\r\n  ```\r\n\r\n* `db`\r\n  Show database-related settings (`DATABASES`, `DEFAULT_AUTO_FIELD`).\r\n  Example:\r\n\r\n  ```bash\r\n  python manage.py db\r\n  ```\r\n\r\n* `diffsettings`\r\n  Display the difference between project settings and Django defaults (similar to Django\u2019s built-in `diffsettings`, but colorized if Rich is available).\r\n  Example:\r\n\r\n  ```bash\r\n  python manage.py diffsettings\r\n  ```\r\n\r\n* `email`\r\n  Show email configuration (`EMAIL_BACKEND`, `EMAIL_HOST`, `EMAIL_PORT`, `DEFAULT_FROM_EMAIL`, `ADMINS`, etc.).\r\n  Example:\r\n\r\n  ```bash\r\n  python manage.py email\r\n  ```\r\n\r\n* `installed`\r\n  Show `INSTALLED_APPS` and related app-level settings (e.g. `DEFAULT_AUTO_FIELD`, `MIGRATION_MODULES`).\r\n  Example:\r\n\r\n  ```bash\r\n  python manage.py installed\r\n  ```\r\n\r\n* `locale`\r\n  Show internationalization and timezone settings (`LANGUAGE_CODE`, `TIME_ZONE`, `USE_I18N`, `USE_TZ`).\r\n  Example:\r\n\r\n  ```bash\r\n  python manage.py locale\r\n  ```\r\n\r\n* `logging`\r\n  Show logging configuration (`LOGGING`, `LOGGING_CONFIG`, `DEFAULT_LOGGING`, etc.).\r\n  Example:\r\n\r\n  ```bash\r\n  python manage.py logging\r\n  ```\r\n\r\n* `media`\r\n  Show media/file upload settings (`MEDIA_URL`, `MEDIA_ROOT`, `DEFAULT_FILE_STORAGE`, and common cloud-storage vars if present).\r\n  Example:\r\n\r\n  ```bash\r\n  python manage.py media\r\n  ```\r\n\r\n* `middleware`\r\n  Show middleware stack plus related flags (`MIDDLEWARE`, `MIDDLEWARE_CLASSES`, `SECURE_*`, `CSRF_*`, `SESSION_*`, CORS settings if present).\r\n  Example:\r\n\r\n  ```bash\r\n  python manage.py middleware\r\n  ```\r\n\r\n* `security`\r\n  Show security & HTTPS-related settings (`CSRF_COOKIE_SECURE`, `SESSION_COOKIE_SECURE`, `SECURE_SSL_REDIRECT`, HSTS settings, `X_FRAME_OPTIONS`, etc.).\r\n  Example:\r\n\r\n  ```bash\r\n  python manage.py security\r\n  ```\r\n\r\n* `session`\r\n  Show session-specific configuration (`SESSION_ENGINE`, cookie names, age, `SESSION_SAVE_EVERY_REQUEST`, `SESSION_FILE_PATH`, etc.).\r\n  Example:\r\n\r\n  ```bash\r\n  python manage.py session\r\n  ```\r\n\r\n* `site`\r\n  Site and environment-level settings (`BASE_DIR`, `ROOT_URLCONF`, `WSGI_APPLICATION`, `ASGI_APPLICATION`, `ALLOWED_HOSTS`, `SITE_ID`, etc.).\r\n  Example:\r\n\r\n  ```bash\r\n  python manage.py site\r\n  ```\r\n\r\n* `static`\r\n  Show static files settings (`STATIC_URL`, `STATICFILES_DIRS`, `STATIC_ROOT`, `STATICFILES_STORAGE`, `STATICFILES_FINDERS`, WhiteNoise options if present).\r\n  Example:\r\n\r\n  ```bash\r\n  python manage.py static\r\n  ```\r\n\r\n* `storage`\r\n  Show storage-related settings (`DEFAULT_FILE_STORAGE`, `STORAGES`, upload limits and permissions, `DATA_UPLOAD_MAX_MEMORY_SIZE`, etc.).\r\n  Example:\r\n\r\n  ```bash\r\n  python manage.py storage\r\n  ```\r\n\r\n* `template`\r\n  Show template engine settings (`TEMPLATES`, `TEMPLATE_DIRS`, `OPTIONS` context processors/loaders/jinja options).\r\n  Example:\r\n\r\n  ```bash\r\n  python manage.py template\r\n  ```\r\n\r\n* `validator`\r\n  Show validation and password-related settings (`AUTH_PASSWORD_VALIDATORS`, `PASSWORD_HASHERS`, `PASSWORD_RESET_TIMEOUT`, etc.) and related auth redirect urls.\r\n  Example:\r\n\r\n  ```bash\r\n  python manage.py validator\r\n  ```\r\n\r\n---\r\n\r\n### Example: colorized output (when `rich` installed)\r\n\r\n```bash\r\npython manage.py static\r\n# prints a colored table with STATIC_URL, STATIC_ROOT, STATICFILES_DIRS, etc.\r\n```\r\n\r\n---\r\n\r\n### Notes & Tips\r\n\r\n* `djinspect` CLI is provided as a convenience and currently runs the `all` command:\r\n\r\n  ```bash\r\n  djinspect all --filter cache\r\n  ```\r\n---\r\n\r\n## \ud83e\uddea Tests (pytest)\r\n\r\n```\r\ntests/\r\n\u251c\u2500\u2500 __init__.py\r\n\u251c\u2500\u2500 conftest.py\r\n\u251c\u2500\u2500 test_core_commands.py\r\n\u2514\u2500\u2500 test_cli.py\r\n```\r\n\r\n### Example `test_cli.py`\r\n\r\n```python\r\nimport subprocess\r\nimport sys\r\n\r\ndef test_cli_all_command():\r\n    result = subprocess.run(\r\n        [sys.executable, \"-m\", \"django_settings_inspector.cli\", \"--filter\", \"DATABASE\"],\r\n        capture_output=True,\r\n        text=True\r\n    )\r\n    assert \"DATABASES\" in result.stdout\r\n\r\ndef test_import_all():\r\n    import django_settings_inspector.management.commands.all as allmod\r\n    assert hasattr(allmod, \"BASE_DIR\")\r\n```\r\n\r\n### Example test file: `tests/test_core_commands.py`\r\n\r\n```python\r\nimport pytest\r\nfrom django.core.management import call_command\r\n\r\n@pytest.mark.django_db\r\ndef test_all_command_runs_safely(settings):\r\n    \"\"\"Ensure 'all' command runs without error.\"\"\"\r\n    call_command(\"all\")\r\n\r\ndef test_specific_command_outputs(settings, capsys):\r\n    \"\"\"Check output contains key variables.\"\"\"\r\n    call_command(\"core\")\r\n    captured = capsys.readouterr()\r\n    assert \"BASE_DIR\" in captured.out\r\n```\r\n\r\nRun tests:\r\n\r\n```bash\r\npytest -v\r\n```\r\n---\r\n\r\n## \ud83d\udca1 Tips for Development\r\n\r\n* Use `pip install -e .` during development\r\n* Use `python -m django_settings_inspector.cli` to test CLI\r\n* To publish to PyPI:\r\n\r\n## \ud83e\uddd1\u200d\ud83d\udcbb Contributing\r\n\r\n1. Fork the repository\r\n2. Create a new branch (`git checkout -b feature/my-feature`)\r\n3. Commit changes (`git commit -am 'Add my feature'`)\r\n4. Push to your branch (`git push origin feature/my-feature`)\r\n5. Open a Pull Request\r\n\r\n---\r\n\r\n## \u2696\ufe0f License\r\n\r\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.\r\n\r\nMIT \u00a9 2025 [Hadi Cahyadi](mailto:cumulus13@gmail.com)\r\n\r\n## author\r\n[Hadi Cahyadi](mailto:cumulus13@gmail.com)\r\n    \r\n\r\n[![Buy Me a Coffee](https://www.buymeacoffee.com/assets/img/custom_images/orange_img.png)](https://www.buymeacoffee.com/cumulus13)\r\n\r\n[![Donate via Ko-fi](https://ko-fi.com/img/githubbutton_sm.svg)](https://ko-fi.com/cumulus13)\r\n \r\n[Support me on Patreon](https://www.patreon.com/cumulus13)\r\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "A Django management and CLI tool to inspect and colorize project settings",
    "version": "1.0.5",
    "project_urls": {
        "Homepage": "https://github.com/cumulus13/django-settings-inspector"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "c370aabbf51e42b07eb7fad82b569b2c5f202ba87dbc30a5a3dec3580d538a04",
                "md5": "4c94571b58681f8d53e671b8b8a0a88a",
                "sha256": "9ad15569f7294a1199b07f5e0a8b37b926b01a6a7223ff2bdef6c46f710a5539"
            },
            "downloads": -1,
            "filename": "django_settings_inspector-1.0.5-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "4c94571b58681f8d53e671b8b8a0a88a",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 30469,
            "upload_time": "2025-10-07T18:27:06",
            "upload_time_iso_8601": "2025-10-07T18:27:06.939738Z",
            "url": "https://files.pythonhosted.org/packages/c3/70/aabbf51e42b07eb7fad82b569b2c5f202ba87dbc30a5a3dec3580d538a04/django_settings_inspector-1.0.5-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "8a08c4b346209d1da41862bd09e00ff33ac78fb9b92212b371744a914ec78cc8",
                "md5": "08d461bf4015ccf10360483e5c21f23d",
                "sha256": "21d3d14ea8745201ddfb1fd25d17e95330f92d6786d15d90493430cc33d59754"
            },
            "downloads": -1,
            "filename": "django_settings_inspector-1.0.5.tar.gz",
            "has_sig": false,
            "md5_digest": "08d461bf4015ccf10360483e5c21f23d",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 26852,
            "upload_time": "2025-10-07T18:27:08",
            "upload_time_iso_8601": "2025-10-07T18:27:08.629879Z",
            "url": "https://files.pythonhosted.org/packages/8a/08/c4b346209d1da41862bd09e00ff33ac78fb9b92212b371744a914ec78cc8/django_settings_inspector-1.0.5.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-10-07 18:27:08",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "cumulus13",
    "github_project": "django-settings-inspector",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "django-settings-inspector"
}
        
Elapsed time: 1.31799s