AL+

Language: RO (română) EN (English)

Email us: paul@alplustech.com

Looking back at the week of 25 September–1 October 2024

Automatic Django plugins should leave configuration inspectable

DJP's early hooks reduced repeated Django setup. Examine the resulting settings, routes and ASGI boundary before treating automatic registration as safe.

Citiți articolul în română

Automatic registration can remove repeated edits while making an application's effective configuration harder to see. A useful plugin system should improve both installation and inspection. Before adopting one, establish how a maintainer discovers the settings, routes and middleware it has added. Fewer lines in the project's settings file do not necessarily mean fewer decisions.

DJP provides an unusually clear historical example. Its author introduced it in a 25 September 2024 post, after presenting the first version the previous day. This November 2026 retrospective examines that early design. It does not treat the project as an established Django standard or recommend it as an AL+ production stack.

Django already had extension mechanisms

The Django 5.1 application reference describes reusable apps containing combinations of models, views, templates, URLs and middleware. Projects connect them through INSTALLED_APPS and other configuration. The 5.1 middleware documentation separately describes hooks in request and response processing, where ordering changes behavior. Those are historical version references, not a recommendation to deploy the now-unsupported 5.1 series.

DJP added a way for installed, compliant packages to contribute that configuration through explicit hooks based on Pluggy. The announcement demonstrates hooks for installed apps, middleware, URL patterns and settings. This is configuration assembly around existing Django mechanisms. It does not replace Django's app registry or make ordinary middleware obsolete.

That distinction helps evaluate the cost. A project with two ordinary extensions may be easiest to understand through a few visible settings and URL edits. A product family repeatedly assembling the same approved extensions may benefit more from packaged registration. The relevant saving is reduced repeated integration work, weighed against the new indirection.

Installation becomes a behavior change

In the announced setup, DJP receives the settings namespace at the end of settings evaluation, and the project's URL configuration includes patterns supplied by plugins. A package can therefore change the running application after installation without another obvious project-level settings diff. The configuration responsibility moves into the plugin and its discovery mechanism.

For a proposed internal reporting product, that can be useful. An approved extension might register its models and pages consistently across installations. The same capability could introduce a route or modify database configuration. This is a design example, not an implemented reporting product. Its value depends on whether those effects remain reviewable before release.

A maintainer should be able to explain the effective configuration from the installed package versions and environment. Record which plugin contributes a route and how conflicting contributions are resolved for the exact version selected. Avoid publishing sensitive setting values merely to make configuration visible. Inspection can show origins and relevant effects without exposing credentials.

Do not assume every hook has the same ordering contract. Settings mutation, middleware contributions and URL assembly can fail differently when two plugins interact. Choose acceptance cases around the actual conflict: a route hidden by an earlier pattern, middleware running before the component it requires, or one database setting replacing another. These are proposed checks, not failures reproduced for this article.

Version 0.3 crossed another boundary

The author's 26 September account of django-plugin-datasette dates the asgi_wrapper() hook to DJP 0.3. It applies to ASGI-served Django applications and can attach a separate application outside Django's normal request/response cycle. The example exposed a Datasette interface to configured SQLite databases and explicitly lacked authentication at that time.

This is a precise maturity and scope warning. It is not evidence that every DJP plugin exposes databases, or that the example still has exactly the same behavior today. The historical author warning supports keeping that experiment local rather than describing it as a protected administration feature.

An outer ASGI application should not be assumed to inherit Django view-level protections. Trace which application receives the request and which authentication and authorization checks run before data is returned. A login policy that governs Django views cannot be credited with protecting a route handled elsewhere without evidence of the actual boundary.

Masking one sensitive column would not settle that question. A database can contain customer records or other confidential fields beyond passwords. The business consequence comes from the whole exposed surface, not whether one recognizable secret was hidden. Automatic installation cannot substitute for deciding who should reach the additional application.

An explicit hook is useful documentation

The attraction of the design is that extensions declare their integration through named points instead of requiring each installer to copy instructions. A reviewer can inspect those points and relate them to effects. That is a credible improvement when repeated manual setup causes drift between deployments.

The current DJP documentation continues to describe automatic configuration and available hooks. Its mutable latest pages are useful for investigating the project now, but they cannot establish when every documented capability arrived. Keep the dated announcement and the 0.3 account as the historical authorities for the features discussed here.

The strongest objection remains simplicity. An ordinary reusable app, explicit URL inclusion and deliberately ordered middleware may already express the project clearly. Adding discovery can hide a small amount of setup behind a larger mechanism. Avoid adopting a plugin system solely because the installation instructions look shorter.

For custom software, decide first whether extensions must be assembled repeatedly or independently. If so, require the plugin design to expose its effective settings, route ownership and security boundary. If explicit Django configuration already makes those facts easy to inspect, keep it. The successful abstraction is one the next maintainer can explain after installation.