Project

Profile

Help

Maintenance: Planio will be observing a scheduled maintenance window this Sunday, November 10, 2024 from 20:00 UTC until 21:00 UTC to perform important network maintenance in our primary data center. Your Planio account will be unavailable for a few minutes during this maintenance window.

Story #6467

closed

As a plugin developer I need configurable MIDDLEWARE list setting

Added by osapryki over 4 years ago. Updated almost 3 years ago.

Status:
CLOSED - DUPLICATE
Priority:
Normal
Assignee:
-
Category:
-
Sprint/Milestone:
-
Start date:
Due date:
% Done:

0%

Estimated time:
Platform Release:
Groomed:
No
Sprint Candidate:
No
Tags:
Sprint:
Quarter:

Description

Ticket moved to GitHub: "pulp/pulpcore/1881":https://github.com/pulp/pulpcore/issues/1881


In actual pulp implementation it is only possible to append values to MIDDLEWARE django setting or completely overriding it.

In some cases inserting value at the beginning of the MIDDLEWARE list may be required. An example of such case is using django_prometheus for adding prometheus metrics endpoint. This plugins requires inserting one middleware class to the beginning of MIDDLEWARE list and second one to the end.

Unfortunately this is not possible without completely overriding MIDDLEWARE list with custom list that has to include all middleware classes copied from pulpcore settings. It may lead to issues in case when the default list in pulpcore repository is updated and has to be synchronized with all plugins that override it in such way.

Propositions:

  1. Move contents of MIDDLEWARE list to DEFAULT_MIDDLEWARE and move it to module default_settings.py, and make it importable and therefore re-usable by plugin developers.

  2. Provide some sort of hooks to inject values to MIDDLEWARE list, for example but not necessary based on plugin entry_points.

MIDDLEWARE may be not the only parameter that requires such customization in future, generic approach to this problem may be useful for long term.

Also available in: Atom PDF