# Path: django_core/utils/loading.py
# def get_setting(key, **kwargs):
#     """Gets a settings key or raises an improperly configured error.
# 
#     :param key: the settings key to get.
#     :param default: the default value to return if no value is found
#     """
#     has_default = 'default' in kwargs
#     default_val = kwargs.get('default')
# 
#     try:
#         if has_default:
#             return getattr(settings, key, default_val)
#         else:
#             return getattr(settings, key)
#     except Exception as e:
#         raise ImproperlyConfigured(
#             _('"{0}" setting has not been properly set. {1}').format(key, e)
#         )


from django.shortcuts import redirect
from django.utils.http import urlencode
from django.utils.six import string_types
from django_core.utils.loading import get_setting
    from urllib.parse import urlparse
    from urllib.parse import parse_qsl
    from urlparse import urlparse
    from urlparse import parse_qsl
from __future__ import unicode_literals



try:
    # python 3
except ImportError:


def is_legit_next_url(next_url):

    if not next_url:
        return False

    is_fully_qualified_url = (next_url.startswith('http') or
                              next_url.startswith('//'))

# Path: django_core/utils/loading.py
# def get_setting(key, **kwargs):
#     """Gets a settings key or raises an improperly configured error.
# 
#     :param key: the settings key to get.
#     :param default: the default value to return if no value is found
#     """
#     has_default = 'default' in kwargs
#     default_val = kwargs.get('default')
# 
#     try:
#         if has_default:
#             return getattr(settings, key, default_val)
#         else:
#             return getattr(settings, key)
#     except Exception as e:
#         raise ImproperlyConfigured(
#             _('"{0}" setting has not been properly set. {1}').format(key, e)
#         )


# Path: django_core/utils/urls.py
from django.shortcuts import redirect
from django.utils.http import urlencode
from django.utils.six import string_types
from django_core.utils.loading import get_setting
    from urllib.parse import urlparse
    from urllib.parse import parse_qsl
    from urlparse import urlparse
    from urlparse import parse_qsl

from __future__ import unicode_literals



try:
    # python 3
except ImportError:


def is_legit_next_url(next_url):

    if not next_url:
        return False

    is_fully_qualified_url = (next_url.startswith('http') or
                              next_url.startswith('//'))

    site_domain = get_setting('SITE_DOMAIN', default=None)