cfpb / django-flags

Feature flags for Django projects
https://cfpb.github.io/django-flags/
Creative Commons Zero v1.0 Universal
256 stars 31 forks source link

Ability to override via query parameter and persist for session? #130

Open truthdoug opened 1 month ago

truthdoug commented 1 month ago

A pattern we've used (with internal code, not django-flags):

With this the priority of choosing the feature or not is:

  1. query parameter - if it exists on the current request, that trumps all (and is set on the session)
  2. django session value - if the feature is explicitly set or unset in the session, use that
  3. global value - otherwise use the site-wide setting

I'm newly finding out about django-flags and I've read through examples in the documentation but don't readily see a way to implement this overriding behavior. Is there a way to do this? Perhaps with a combination of conditions for the feature?