{"categories":[{"label":"Database","url":"https://skillfed.io/packages/category/database/4"}],"enrichment":{"capability":"Prevents Django database write operations by intercepting and blocking data modification queries, with the ability to selectively re-enable writes within a session.","skillfed_tags":["django-extension","database-safety","interactive-shell"],"use_cases":["Enable read-only mode in production shell sessions to prevent developers from accidentally modifying data during exploratory queries.","Protect staging environments during interactive debugging by blocking write queries while allowing reads.","Temporarily allow writes within a context manager to run a specific management command or data fix without disabling read-only mode globally.","Use the IPython extension to quickly toggle read-only mode on and off during interactive development sessions.","Enforce a safe-by-default policy where writes are disabled in interactive shells but remain enabled for automated processes like WSGI servers."],"what_it_does":"django-read-only is a Django package that enforces read-only mode on your database by intercepting and rejecting data modification queries. It works by inspecting executed queries at the Django database instrumentation layer and raising an exception when a write is detected. The package is designed for interactive sessions\u2014particularly shell environments in production or staging\u2014where developers need to run exploratory queries without risking accidental data changes.\n\nYou control read-only mode via a setting or environment variable, and can temporarily or permanently re-enable writes within a session using provided functions and context managers. It also integrates with IPython as an extension for quick toggling. The package uses a \"fail closed\" philosophy, meaning unknown query patterns are blocked to be safe. Note that it cannot intercept queries bypassing Django's ORM entirely or operations within stored procedures.","worth_installing":"Yes. This is a lightweight, actively maintained package with no security vulnerabilities that solves a real operational safety problem\u2014preventing accidental database modifications in interactive sessions. The low install friction (one dependency), permissive MIT license, and production-stable status make it a practical choice for teams running Django in production or staging environments where shell access is common."},"id":"django-read-only","links":{"html":"https://skillfed.io/packages/django-read-only","md":"https://skillfed.io/packages/django-read-only.md","pypi":"https://pypi.org/project/django-read-only/"},"maintenance":{"status":"active"},"meta":{"latest_release":"2025-09-18","license_spdx":"MIT","license_treatment":"permissive","name":"django-read-only","python_support":"supports_current","summary":"Disable Django database writes."},"popularity":{"monthly_downloads":125021,"position":11841,"tier":"top_15000"},"security":{"n_vulnerabilities":0},"version":"1.21.0"}
