-
-
Notifications
You must be signed in to change notification settings - Fork 256
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Waffle can't be used directly on DRF's request objects #221
Comments
I want to make sure I'm following this correctly, the issue is something like this: class MyView(rest_framework.APIView):
def get(self, request, id=None):
if waffle.flag_is_active(request, 'foo'): # request is a rest_framework.request.Request
pass
return Response(stuff, etc=other_stuff) Waffle will create the The problem is that this gets into weird DRF internals that aren't public APIs and are subject to change. I think the original, What happens if you do If that works, I'm not sure what to do. I really don't like the idea of mucking with internals or accepting a bunch of code in waffle to deal with the problems DRF creates with its |
We tried |
Nah, leave it open for now. Maybe it turns into documentation or a |
👋 hi folks from #295. The problem I identified in this comment #221 (comment) may not be the most important part of the issue. If #1 (comment) is implemented, I don't believe there will be a need to store the I still would rather keep DRF-specific code segregated—especially if there are optional requirements. I'd rather not duck-type DRF |
Coming over from #295. Myself and @martinburchell are using the
That all sounds sensible! We could probably work on a PR for this if we get a green light. Is there some blocking issues on this? |
Update facility history endpoint tests to use the `can_get_facility_history` feature flag. Update facility history endpoint code to replace switch with flag. Replace endpoint decorator with custom flag_is_active check to circumvent a quirk with using waffle & DRF documented here: jazzband/django-waffle#221
Update facility history endpoint tests to use the `can_get_facility_history` feature flag. Update facility history endpoint code to replace switch with flag. Replace endpoint decorator with custom flag_is_active check to circumvent a quirk with using waffle & DRF documented here: jazzband/django-waffle#221
Update facility history endpoint tests to use the `can_get_facility_history` feature flag. Update facility history endpoint code to replace switch with flag. Replace endpoint decorator with custom flag_is_active check to circumvent a quirk with using waffle & DRF documented here: jazzband/django-waffle#221
Update facility history endpoint tests to use the `can_get_facility_history` feature flag. Update facility history endpoint code to replace switch with flag. Replace endpoint decorator with custom flag_is_active check to circumvent a quirk with using waffle & DRF documented here: jazzband/django-waffle#221
We are building a Django Web Application using Django Rest Framework and AngularJS. We would like to add feature flipping (feature flags) to our framework. Our framework uses token authentication.
We have a problem when we use feature flags based on percentage of users. Waffle appends the attribute "waffles" to the request object. But the attribute does not exist when processed by the waffle middleware.
The request object we are sending is a rest_framework.request.Request type. In the middleware we get a request of type django.core.handlers.wsgi.WSGIRequest
See: http://stackoverflow.com/questions/38373474/is-django-waffle-suited-to-work-with-django-rest-framework-drf
The text was updated successfully, but these errors were encountered: