I have an API that i need to remove something from cache of Redis So I build a view and sync it to a url but I keep getting HTTP_404 (not found).
class ExpireRoom(APIView):
permission_classes = (IsAuthenticated, )
def delete(self, request, format=None):
room_manager = RoomManager()
room_identifier = self.kwargs['room_identifier']
is_success = room_manager.delete(room_identifier)
if is_success:
return Response(status=status.HTTP_200_OK)
else:
return Response(status=status.HTTP_500_INTERNAL_SERVER_ERROR)
Here's my url in urls.py:
urlpatterns = [
url(r'^expire-room/(?P<room_identifier>\w+)/$',
ExpireRoom.as_view(),
name='core_ExpireRoom_deletingRoom')
]
request.GETdictionary.