<reponame>chessbr/shuup-api
# -*- coding: utf-8 -*-
# This file is part of Shuup.
#
# Copyright (c) 2012-2021, Shuup Commerce Inc. All rights reserved.
#
# This source code is licensed under the Shuup Commerce Inc -
# SELF HOSTED SOFTWARE LICENSE AGREEMENT executed by Shuup Commerce Inc, DBA as SHUUP®
# and the Licensee.
import shuup.apps
from django.core.exceptions import ImproperlyConfigured


class AppConfig(shuup.apps.AppConfig):
    name = "shuup_api"
    verbose_name = "Shuup API"
    label = "shuup_api"
    required_installed_apps = ("rest_framework",)

    provides = {
        "admin_module": [
            "shuup_api.admin_module:APIModule",
        ]
    }

    def ready(self):
        from django.conf import settings

        rest_framework_config = getattr(settings, "REST_FRAMEWORK", None)
        if not (rest_framework_config and rest_framework_config.get("DEFAULT_PERMISSION_CLASSES")):
            raise ImproperlyConfigured(
                "Error! `shuup_api` REQUIRES explicit configuration of `REST_FRAMEWORK['DEFAULT_PERMISSION_CLASSES']` "
                "in your settings file. This is to avoid all of your shop's orders being world-readable-and-writable."
            )

# -*- coding: utf-8 -*-
# This file is part of Shuup.
#
# Copyright (c) 2012-2021, Shuup Commerce Inc. All rights reserved.
#
# This source code is licensed under the Shuup Commerce Inc -
# SELF HOSTED SOFTWARE LICENSE AGREEMENT executed by Shuup Commerce Inc, DBA as SHUUP®
# and the Licensee.
import shuup.apps
from django.core.exceptions import ImproperlyConfigured


class AppConfig(shuup.apps.AppConfig):
    name = "shuup_api"
    verbose_name = "Shuup API"
    label = "shuup_api"
    required_installed_apps = ("rest_framework",)

    provides = {
        "admin_module": [
            "shuup_api.admin_module:APIModule",
        ]
    }

    def ready(self):
        from django.conf import settings

        rest_framework_config = getattr(settings, "REST_FRAMEWORK", None)
        if not (rest_framework_config and rest_framework_config.get("DEFAULT_PERMISSION_CLASSES")):
            raise ImproperlyConfigured(
                "Error! `shuup_api` REQUIRES explicit configuration of `REST_FRAMEWORK['DEFAULT_PERMISSION_CLASSES']` "
                "in your settings file. This is to avoid all of your shop's orders being world-readable-and-writable."
            )
# -*- coding: utf-8 -*- # This file is part of Shuup. # # Copyright (c) 2012-2021, Shuup Commerce Inc. All rights reserved. # # This source code is licensed under the Shuup Commerce Inc - # SELF HOSTED SOFTWARE LICENSE AGREEMENT executed by Shuup Commerce Inc, DBA as SHUUP® # and the Licensee.