-
-
Notifications
You must be signed in to change notification settings - Fork 53
Description
The installation instructions says that we shoul "Add maintenance_mode.middleware.MaintenanceModeMiddleware to settings.MIDDLEWARE as last middleware".
I think the documentation needs to be updated with guidance to when to divert from putting the middleware last.
In many cases, I think it is fine, but I would argue that there are cases where maintenance_mode.middleware.MaintenanceModeMiddleware should go before all other middleware.
Consider the following cases:
- You need to run something to update all your users.
- You deploy to the cloud, and you want to automate maintenance mode while migrating the database and replacing pods with the updated ones.
In both cases about, it is undesirable that other middleware, such as your seession middleware (if you use DB sessions), or the authentication middleware, hits the database.
I work on a project where both of the above (+ more) may apply, so we have put maintenance_mode.middleware.MaintenanceModeMiddleware top-most, and use MAINTENANCE_MODE_IGNORE_URLS to allow access to the admin and our URL for the k8s liveness probe.
Metadata
Metadata
Assignees
Labels
Projects
Status