# Path: common_configs/utils.py
# def merge_items(base, new_items):
#     """
#     Merges two lists and eliminates duplicates
# 
#     :type base: list
#     :type new_items: list
#     :rtype: list
#     """
#     for item in new_items:
#         if not item in base:
#             base = base + [item]
#     return base


from configurations import values
from ..utils import merge_items
            import urlparse
    ###########################################################
    # Cookie and session settings

    #: https://docs.djangoproject.com/en/dev/ref/settings/#std:setting-SESSION_COOKIE_SECURE
    SESSION_COOKIE_SECURE = values.BooleanValue(False)

    #: https://docs.djangoproject.com/en/dev/ref/settings/#std:setting-SESSION_COOKIE_HTTPONLY
    SESSION_COOKIE_HTTPONLY = values.BooleanValue(True)

    #: https://docs.djangoproject.com/en/dev/ref/settings/#std:setting-CSRF_COOKIE_SECURE
    CSRF_COOKIE_SECURE = values.BooleanValue(False)

    ###########################################################
    # SSL and content security settings

    #: http://django-secure.rtfd.org/latest/settings.html#secure-frame-deny
    SECURE_FRAME_DENY = values.BooleanValue(True)

    #: http://django-secure.rtfd.org/latest/settings.html#secure-content-type-nosniff
    SECURE_CONTENT_TYPE_NOSNIFF = values.BooleanValue(True)

    #: http://django-secure.rtfd.org/latest/settings.html#secure-browser-xss-filter
    SECURE_BROWSER_XSS_FILTER = values.BooleanValue(True)

    @property
    def INSTALLED_APPS(self):
        """
        Appends :mod:`djangosecure` to list of ``INSTALLED_APPS``.
        """
        apps = super(DjangoSecurity, self).INSTALLED_APPS

# Path: common_configs/utils.py
# def merge_items(base, new_items):
#     """
#     Merges two lists and eliminates duplicates
# 
#     :type base: list
#     :type new_items: list
#     :rtype: list
#     """
#     for item in new_items:
#         if not item in base:
#             base = base + [item]
#     return base


# Path: common_configs/django/security.py
from configurations import values
from ..utils import merge_items
            import urlparse

    ###########################################################
    # Cookie and session settings

    #: https://docs.djangoproject.com/en/dev/ref/settings/#std:setting-SESSION_COOKIE_SECURE
    SESSION_COOKIE_SECURE = values.BooleanValue(False)

    #: https://docs.djangoproject.com/en/dev/ref/settings/#std:setting-SESSION_COOKIE_HTTPONLY
    SESSION_COOKIE_HTTPONLY = values.BooleanValue(True)

    #: https://docs.djangoproject.com/en/dev/ref/settings/#std:setting-CSRF_COOKIE_SECURE
    CSRF_COOKIE_SECURE = values.BooleanValue(False)

    ###########################################################
    # SSL and content security settings

    #: http://django-secure.rtfd.org/latest/settings.html#secure-frame-deny
    SECURE_FRAME_DENY = values.BooleanValue(True)

    #: http://django-secure.rtfd.org/latest/settings.html#secure-content-type-nosniff
    SECURE_CONTENT_TYPE_NOSNIFF = values.BooleanValue(True)

    #: http://django-secure.rtfd.org/latest/settings.html#secure-browser-xss-filter
    SECURE_BROWSER_XSS_FILTER = values.BooleanValue(True)

    @property
    def INSTALLED_APPS(self):
        """
        Appends :mod:`djangosecure` to list of ``INSTALLED_APPS``.
        """
        apps = super(DjangoSecurity, self).INSTALLED_APPS

        return merge_items(apps, ["djangosecure"])