Currently in private beta

The fastest way to build top-notch apps with less code

Introducing the powerful combination of Flutter, Django, and Kubernetes - the DjangoFlow framework. Built-in open source following the Don't Repeat Yourself and zero tech debt principle
Perfect for developers who demand

High efficiency

Short deadlines

Cost savings

Thank you! Your submission has been received!
Oops! Something went wrong while submitting the form.

Experience the power of the open-source, highly scalable, and fast full-stack framework.

 
   @ensure_backend_effective
    def generate_challenge(self, request, **kwargs) 
    -> Optional[User]:
        """
        Generate and send OTP code
        """

        device = self.get_device(**kwargs)
        user = request.user

        if device is None:
            if not user.is_authenticated:
                if api_settings.SIGNIN_AUTOCREATE_ACCOUNT:
                    user = self.create_user(request, **kwargs)
                else:
                    return None
            device = self.create_device(user, **kwargs)
        else:
            if user.is_authenticated and user != device.user:
                raise DeviceTakenError()

        self.send_otp(device, **kwargs)
        return device.user

    @ensure_backend_effective
    def authenticate(self, request, **kwargs) 
    -> Optional[User]:
        """
        Check OTP and authenticate User
        """
        if otp := kwargs.get("otp"):
            if device := self.get_device(**kwargs):
                if self.user_can_authenticate(device.user):
                    return self.authenticate_device(device, otp)

    @ensure_backend_effective
    def connect(self, request, **kwargs) -> Optional[User]:
        """
        Check OTP and connects Device to the User
        """
        return self.authenticate(request, **kwargs)

    @ensure_backend_effective
    def unlink(self, request, **kwargs):
        device = self.get_device(**kwargs)
        if not device:
            raise DeviceDoesNotExistError()

Heading

Python/Django

 
  class BaseModelRule(GenericBase[M], models.Model):
    model: Type[M]
    tracking_fields: Optional[List[str]] = None

    @classmethod
    def is_field_changed(cls, instance: M, prev: Optional[M]):
        if cls.tracking_fields is None or prev is None:
            return True

        for field in cls.tracking_fields:
            if getattr(instance, field) != getattr(prev, field):
                return True

        return False

    @classmethod
    def get_queryset(cls, instance: M, prev: Optional[M]) 
				-> QuerySet["BaseModelRule"]:
        return cls.objects.all()

    def check_condition(self, instance: M, prev: Optional[M]) 
    		-> bool:
        return True

    def perform_action(self, instance: M):
        pass

    @classmethod
    def invoke(cls, instance: M):
        prev = getattr(instance, "_pre_save_instance", None)

        if not cls.is_field_changed(instance, prev):
            return

        for action in cls.get_queryset(instance, prev):
            if action.check_condition(instance, prev):
                action.perform_action(instance)

    class Meta:
        abstract = True
  
        

Heading

Dart/Flutter

Sign up for our closed beta

Be among the first to experience the power of Flutter, Django, and Kubernetes combined.
Thank you! Your submission has been received!
Oops! Something went wrong while submitting the form.