@list_route(methods=['post'])
    def activate_account(self, request):
        from django.contrib.auth.models import User

        try:
            activation_key = request.data.get('activation_key', None)
            activate_user = RegistrationModel.objects.get(activation_key=activation_key)
            if activate_user:
                user = User.objects.get(id=activate_user.user_id)
                user.is_active = 1
                user.save()
                activate_user.delete()
                return Response(data={"message": "Account activated successfully"}, status=status.HTTP_200_OK)
        except RegistrationModel.DoesNotExist:
            return Response(data={"message": "Your account couldn't be activated. It may already be active."},
                            status=status.HTTP_400_BAD_REQUEST)
this handles the account activation after the user follows the link from his/her email.
dataset/ETHPy150Open crowdresearch/crowdsource-platform/crowdsourcing/viewsets/user.py/UserViewSet.activate_account