(app_configs=None, **kwargs)
return messages
Check that the DJSTRIPE_USE_NATIVE_JSONFIELD isn't set unless Postgres is in use.
    Only used on Django < 3.1.
Check that the DJSTRIPE_USE_NATIVE_JSONFIELD isn't set unless Postgres is in use.
    Only used on Django < 3.1.
Check that the DJSTRIPE_USE_NATIVE_JSONFIELD isn t set unless Postgres is in use . Only used on Django < 3 . 1 .
def check_native_jsonfield_postgres_engine(app_configs=None, **kwargs):
    """
    Check that the DJSTRIPE_USE_NATIVE_JSONFIELD isn't set unless Postgres is in use.
    Only used on Django < 3.1.
    """
    from .settings import djstripe_settings

    messages = []
    error_msg = (
        "DJSTRIPE_USE_NATIVE_JSONFIELD is not compatible with engine {engine} "
        "for database {name}"
    )

    # This error check is skipped on Django 3.1+, because the native JSONField
    # will be used, which is compatible with mysql and sqlite.
    # https://docs.djangoproject.com/en/dev/releases/3.1/#postgresql-jsonfield
    if django.VERSION >= (3, 1):
        return messages

    if djstripe_settings.USE_NATIVE_JSONFIELD:
        for db_name, db_config in settings.DATABASES.items():
            # Hi there.
            # You may be reading this because you are using Postgres, but
            # dj-stripe is not detecting that correctly. For example, maybe you
            # are using multiple databases with different engines, or you have
            # your own backend. As long as you are certain you can support jsonb,
            # you can use the SILENCED_SYSTEM_CHECKS setting to ignore this check.
            engine = db_config.get("ENGINE", "")
            if "postgresql" not in engine and "postgis" not in engine:
                messages.append(
                    checks.Critical(
                        error_msg.format(name=repr(db_name), engine=repr(engine)),
                        hint="Switch to Postgres, or unset "
                        "DJSTRIPE_USE_NATIVE_JSONFIELD",
                        id="djstripe.C005",
                    )
                )

    return messages
def check_native_jsonfield_postgres_engine ( app_configs = None , * * kwargs ) : from . settings import djstripe_settings messages = [ ] error_msg = ( "DJSTRIPE_USE_NATIVE_JSONFIELD is not compatible with engine {engine} " "for database {name}" ) # This error check is skipped on Django 3.1+, because the native JSONField # will be used, which is compatible with mysql and sqlite. # https://docs.djangoproject.com/en/dev/releases/3.1/#postgresql-jsonfield if django . VERSION >= ( 3 , 1 ) : return messages if djstripe_settings . USE_NATIVE_JSONFIELD : for db_name , db_config in settings . DATABASES . items ( ) : # Hi there. # You may be reading this because you are using Postgres, but # dj-stripe is not detecting that correctly. For example, maybe you # are using multiple databases with different engines, or you have # your own backend. As long as you are certain you can support jsonb, # you can use the SILENCED_SYSTEM_CHECKS setting to ignore this check. engine = db_config . get ( "ENGINE" , "" ) if "postgresql" not in engine and "postgis" not in engine : messages . append ( checks . Critical ( error_msg . format ( name = repr ( db_name ) , engine = repr ( engine ) ) , hint = "Switch to Postgres, or unset " "DJSTRIPE_USE_NATIVE_JSONFIELD" , id = "djstripe.C005" , ) ) return messages