"""
Django settings for onlinerequest project.

Generated by 'django-admin startproject' using Django 1.11.3.

For more information on this file, see
https://docs.djangoproject.com/en/1.11/topics/settings/

For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.11/ref/settings/
"""

import os
import ldap
from django_auth_ldap.config import LDAPSearch, LDAPGroupQuery, NestedActiveDirectoryGroupType

# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))


# Quick-start development settings - unsuitable for production
# See https://docs.djangoproject.com/en/1.11/howto/deployment/checklist/

# SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY = 'xj@v3zf9nhhe_*!ei*24y3u)xv6&hof*t*k2b9@dp+uhy)jm9l'

# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = True

ALLOWED_HOSTS = ['*']


# Application definition

INSTALLED_APPS = [
    'django.contrib.admin',
    'django.contrib.auth',
    'django.contrib.contenttypes',
    'django.contrib.sessions',
    'django.contrib.messages',
    'django.contrib.staticfiles',
	'onlinerequest',

]

MIDDLEWARE = [
    'django.middleware.security.SecurityMiddleware',
    'django.contrib.sessions.middleware.SessionMiddleware',
    'django.middleware.common.CommonMiddleware',
    'django.middleware.csrf.CsrfViewMiddleware',
    'django.contrib.auth.middleware.AuthenticationMiddleware',
    'django.contrib.messages.middleware.MessageMiddleware',
    'django.middleware.clickjacking.XFrameOptionsMiddleware',
]

ROOT_URLCONF = 'onlinerequest.urls'

TEMPLATES = [
    {
        'BACKEND': 'django.template.backends.django.DjangoTemplates',
        'DIRS': [],
        'APP_DIRS': True,
        'OPTIONS': {
            'context_processors': [
                'django.template.context_processors.debug',
                'django.template.context_processors.request',
                'django.contrib.auth.context_processors.auth',
                'django.contrib.messages.context_processors.messages',
            ],
        },
    },
]

WSGI_APPLICATION = 'onlinerequest.wsgi.application'


# Database
# https://docs.djangoproject.com/en/1.11/ref/settings/#databases

DATABASES = {
    'default': {
#        'ENGINE': 'django.db.backends.sqlite3',
#        'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
		'ENGINE': 'django.db.backends.mysql',
		'NAME': 'onlinerequest',
		'USER': 'onlinerequest',
		'PASSWORD': '+AwaP5AO<Vfx',
		'HOST':	'localhost',

    }
}


# Password validation
# https://docs.djangoproject.com/en/1.11/ref/settings/#auth-password-validators

AUTH_PASSWORD_VALIDATORS = [
    {
        'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
    },
    {
        'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator',
    },
    {
        'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator',
    },
    {
        'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator',
    },
]


# Binding and connection options
AUTH_LDAP_SERVER_URI = "ldap://DC2012.ptcc.design:389"
AUTH_LDAP_BIND_DN = "CN=Administrator,CN=Users,DC=ptcc,DC=design"
AUTH_LDAP_BIND_PASSWORD = "B45-mt@9]7"
#AUTH_LDAP_BIND_DN = "CN=Timesheet,OU=Services,OU=Global,DC=ptcc,DC=design"
#AUTH_LDAP_BIND_PASSWORD = "eff!grymm4"
AUTH_LDAP_CONNECTION_OPTIONS = {
    ldap.OPT_DEBUG_LEVEL: 1,
    ldap.OPT_REFERRALS: 0,
}

# User and group search objects and types
AUTH_LDAP_USER_SEARCH = LDAPSearch("DC=ptcc,DC=design",
    ldap.SCOPE_SUBTREE, "(sAMAccountName=%(user)s)")
AUTH_LDAP_GROUP_SEARCH = LDAPSearch("DC=ptcc,DC=design",
    ldap.SCOPE_SUBTREE, "(objectClass=group)")
AUTH_LDAP_GROUP_TYPE = NestedActiveDirectoryGroupType()

# Cache settings
AUTH_LDAP_CACHE_GROUPS = True
AUTH_LDAP_GROUP_CACHE_TIMEOUT = 10

# What to do once the user is authenticated
AUTH_LDAP_USER_ATTR_MAP = {
    "first_name": "givenName",
    "last_name": "sn",
    "email": "mail"
}
AUTH_LDAP_USER_FLAGS_BY_GROUP = {
#    "is_staff": ["CN=IT Managers,OU=IT Managers,OU=Global,DC=ptcc,DC=design"]
    "is_staff": (
		LDAPGroupQuery("CN=Domain Users,CN=Users,DC=ptcc,DC=design") |
		LDAPGroupQuery("CN=Accountants,OU=Accountants,OU=Global,DC=ptcc,DC=design") |
		LDAPGroupQuery("CN=Assistants,OU=Assistants,OU=Global,DC=ptcc,DC=design") |
		LDAPGroupQuery("CN=Contract Managers,OU=Contract Managers,OU=Global,DC=ptcc,DC=design") |
		LDAPGroupQuery("CN=Designers,OU=Designers,OU=Global,DC=ptcc,DC=design") |
		LDAPGroupQuery("CN=Document Controllers,OU=Document Controllers,OU=Global,DC=ptcc,DC=design") |
		LDAPGroupQuery("CN=Engineers,OU=Engineers,OU=Global,DC=ptcc,DC=design") |
		LDAPGroupQuery("CN=Executives,OU=Executives,OU=Global,DC=ptcc,DC=design") |
		LDAPGroupQuery("CN=HR Managers,OU=HR Managers,OU=Global,DC=ptcc,DC=design") |
		LDAPGroupQuery("CN=IT Managers,OU=IT Managers,OU=Global,DC=ptcc,DC=design")
				),
	"is_superuser": ["CN=IT Managers,OU=IT Managers,OU=Global,DC=ptcc,DC=design"]

}
AUTH_LDAP_FIND_GROUP_PERMS = True

# The backends needed to make this work.

AUTHENTICATION_BACKENDS = (
	'django_auth_ldap.backend.LDAPBackend',
	'django.contrib.auth.backends.ModelBackend',
)

LOGGING = {
    'version': 1,
    'disable_existing_loggers': False,
    'handlers': {
        'mail_admins': {
            'level': 'ERROR',
            'class': 'django.utils.log.AdminEmailHandler'
        },
        'stream_to_console': {
            'level': 'DEBUG',
            'class': 'logging.StreamHandler'
        },
    },
    'loggers': {
        'django.request': {
            'handlers': ['mail_admins'],
            'level': 'ERROR',
            'propagate': True,
        },
        'django_auth_ldap': {
            'handlers': ['stream_to_console'],
            'level': 'DEBUG',
            'propagate': True,
        },
    }
}


# Internationalization
# https://docs.djangoproject.com/en/1.11/topics/i18n/

LANGUAGE_CODE = 'en-us'

TIME_ZONE = 'Asia/Manila'

USE_I18N = True

USE_L10N = True

USE_TZ = True


# Static files (CSS, JavaScript, Images)
# https://docs.djangoproject.com/en/1.11/howto/static-files/

STATIC_URL = '/static/'

0967f3e81ea1cd2a8c4d0c1e8cedbe887273d6d5
<mask token>

<mask token>
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
SECRET_KEY = 'xj@v3zf9nhhe_*!ei*24y3u)xv6&hof*t*k2b9@dp+uhy)jm9l'
DEBUG = True
ALLOWED_HOSTS = ['*']
INSTALLED_APPS = ['django.contrib.admin', 'django.contrib.auth',
    'django.contrib.contenttypes', 'django.contrib.sessions',
    'django.contrib.messages', 'django.contrib.staticfiles', 'onlinerequest']
MIDDLEWARE = ['django.middleware.security.SecurityMiddleware',
    'django.contrib.sessions.middleware.SessionMiddleware',
    'django.middleware.common.CommonMiddleware',
    'django.middleware.csrf.CsrfViewMiddleware',
    'django.contrib.auth.middleware.AuthenticationMiddleware',
    'django.contrib.messages.middleware.MessageMiddleware',
    'django.middleware.clickjacking.XFrameOptionsMiddleware']
ROOT_URLCONF = 'onlinerequest.urls'
TEMPLATES = [{'BACKEND': 'django.template.backends.django.DjangoTemplates',
    'DIRS': [], 'APP_DIRS': True, 'OPTIONS': {'context_processors': [
    'django.template.context_processors.debug',
    'django.template.context_processors.request',
    'django.contrib.auth.context_processors.auth',
    'django.contrib.messages.context_processors.messages']}}]
WSGI_APPLICATION = 'onlinerequest.wsgi.application'
DATABASES = {'default': {'ENGINE': 'django.db.backends.mysql', 'NAME':
    'onlinerequest', 'USER': 'onlinerequest', 'PASSWORD': '+AwaP5AO<Vfx',
    'HOST': 'localhost'}}
AUTH_PASSWORD_VALIDATORS = [{'NAME':
    'django.contrib.auth.password_validation.UserAttributeSimilarityValidator'
    }, {'NAME':
    'django.contrib.auth.password_validation.MinimumLengthValidator'}, {
    'NAME':
    'django.contrib.auth.password_validation.CommonPasswordValidator'}, {
    'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator'}
    ]
AUTH_LDAP_SERVER_URI = 'ldap://DC2012.ptcc.design:389'
AUTH_LDAP_BIND_DN = 'CN=Administrator,CN=Users,DC=ptcc,DC=design'
AUTH_LDAP_BIND_PASSWORD = 'B45-mt@9]7'
AUTH_LDAP_CONNECTION_OPTIONS = {ldap.OPT_DEBUG_LEVEL: 1, ldap.OPT_REFERRALS: 0}
AUTH_LDAP_USER_SEARCH = LDAPSearch('DC=ptcc,DC=design', ldap.SCOPE_SUBTREE,
    '(sAMAccountName=%(user)s)')
AUTH_LDAP_GROUP_SEARCH = LDAPSearch('DC=ptcc,DC=design', ldap.SCOPE_SUBTREE,
    '(objectClass=group)')
AUTH_LDAP_GROUP_TYPE = NestedActiveDirectoryGroupType()
AUTH_LDAP_CACHE_GROUPS = True
AUTH_LDAP_GROUP_CACHE_TIMEOUT = 10
AUTH_LDAP_USER_ATTR_MAP = {'first_name': 'givenName', 'last_name': 'sn',
    'email': 'mail'}
AUTH_LDAP_USER_FLAGS_BY_GROUP = {'is_staff': LDAPGroupQuery(
    'CN=Domain Users,CN=Users,DC=ptcc,DC=design') | LDAPGroupQuery(
    'CN=Accountants,OU=Accountants,OU=Global,DC=ptcc,DC=design') |
    LDAPGroupQuery(
    'CN=Assistants,OU=Assistants,OU=Global,DC=ptcc,DC=design') |
    LDAPGroupQuery(
    'CN=Contract Managers,OU=Contract Managers,OU=Global,DC=ptcc,DC=design'
    ) | LDAPGroupQuery(
    'CN=Designers,OU=Designers,OU=Global,DC=ptcc,DC=design') |
    LDAPGroupQuery(
    'CN=Document Controllers,OU=Document Controllers,OU=Global,DC=ptcc,DC=design'
    ) | LDAPGroupQuery(
    'CN=Engineers,OU=Engineers,OU=Global,DC=ptcc,DC=design') |
    LDAPGroupQuery(
    'CN=Executives,OU=Executives,OU=Global,DC=ptcc,DC=design') |
    LDAPGroupQuery(
    'CN=HR Managers,OU=HR Managers,OU=Global,DC=ptcc,DC=design') |
    LDAPGroupQuery(
    'CN=IT Managers,OU=IT Managers,OU=Global,DC=ptcc,DC=design'),
    'is_superuser': [
    'CN=IT Managers,OU=IT Managers,OU=Global,DC=ptcc,DC=design']}
AUTH_LDAP_FIND_GROUP_PERMS = True
AUTHENTICATION_BACKENDS = ('django_auth_ldap.backend.LDAPBackend',
    'django.contrib.auth.backends.ModelBackend')
LOGGING = {'version': 1, 'disable_existing_loggers': False, 'handlers': {
    'mail_admins': {'level': 'ERROR', 'class':
    'django.utils.log.AdminEmailHandler'}, 'stream_to_console': {'level':
    'DEBUG', 'class': 'logging.StreamHandler'}}, 'loggers': {
    'django.request': {'handlers': ['mail_admins'], 'level': 'ERROR',
    'propagate': True}, 'django_auth_ldap': {'handlers': [
    'stream_to_console'], 'level': 'DEBUG', 'propagate': True}}}
LANGUAGE_CODE = 'en-us'
TIME_ZONE = 'Asia/Manila'
USE_I18N = True
USE_L10N = True
USE_TZ = True
STATIC_URL = '/static/'

<mask token>
import os
import ldap
from django_auth_ldap.config import LDAPSearch, LDAPGroupQuery, NestedActiveDirectoryGroupType
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
SECRET_KEY = 'xj@v3zf9nhhe_*!ei*24y3u)xv6&hof*t*k2b9@dp+uhy)jm9l'
DEBUG = True
ALLOWED_HOSTS = ['*']
INSTALLED_APPS = ['django.contrib.admin', 'django.contrib.auth',
    'django.contrib.contenttypes', 'django.contrib.sessions',
    'django.contrib.messages', 'django.contrib.staticfiles', 'onlinerequest']
MIDDLEWARE = ['django.middleware.security.SecurityMiddleware',
    'django.contrib.sessions.middleware.SessionMiddleware',
    'django.middleware.common.CommonMiddleware',
    'django.middleware.csrf.CsrfViewMiddleware',
    'django.contrib.auth.middleware.AuthenticationMiddleware',
    'django.contrib.messages.middleware.MessageMiddleware',
    'django.middleware.clickjacking.XFrameOptionsMiddleware']
ROOT_URLCONF = 'onlinerequest.urls'
TEMPLATES = [{'BACKEND': 'django.template.backends.django.DjangoTemplates',
    'DIRS': [], 'APP_DIRS': True, 'OPTIONS': {'context_processors': [
    'django.template.context_processors.debug',
    'django.template.context_processors.request',
    'django.contrib.auth.context_processors.auth',
    'django.contrib.messages.context_processors.messages']}}]
WSGI_APPLICATION = 'onlinerequest.wsgi.application'
DATABASES = {'default': {'ENGINE': 'django.db.backends.mysql', 'NAME':
    'onlinerequest', 'USER': 'onlinerequest', 'PASSWORD': '+AwaP5AO<Vfx',
    'HOST': 'localhost'}}
AUTH_PASSWORD_VALIDATORS = [{'NAME':
    'django.contrib.auth.password_validation.UserAttributeSimilarityValidator'
    }, {'NAME':
    'django.contrib.auth.password_validation.MinimumLengthValidator'}, {
    'NAME':
    'django.contrib.auth.password_validation.CommonPasswordValidator'}, {
    'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator'}
    ]
AUTH_LDAP_SERVER_URI = 'ldap://DC2012.ptcc.design:389'
AUTH_LDAP_BIND_DN = 'CN=Administrator,CN=Users,DC=ptcc,DC=design'
AUTH_LDAP_BIND_PASSWORD = 'B45-mt@9]7'
AUTH_LDAP_CONNECTION_OPTIONS = {ldap.OPT_DEBUG_LEVEL: 1, ldap.OPT_REFERRALS: 0}
AUTH_LDAP_USER_SEARCH = LDAPSearch('DC=ptcc,DC=design', ldap.SCOPE_SUBTREE,
    '(sAMAccountName=%(user)s)')
AUTH_LDAP_GROUP_SEARCH = LDAPSearch('DC=ptcc,DC=design', ldap.SCOPE_SUBTREE,
    '(objectClass=group)')
AUTH_LDAP_GROUP_TYPE = NestedActiveDirectoryGroupType()
AUTH_LDAP_CACHE_GROUPS = True
AUTH_LDAP_GROUP_CACHE_TIMEOUT = 10
AUTH_LDAP_USER_ATTR_MAP = {'first_name': 'givenName', 'last_name': 'sn',
    'email': 'mail'}
AUTH_LDAP_USER_FLAGS_BY_GROUP = {'is_staff': LDAPGroupQuery(
    'CN=Domain Users,CN=Users,DC=ptcc,DC=design') | LDAPGroupQuery(
    'CN=Accountants,OU=Accountants,OU=Global,DC=ptcc,DC=design') |
    LDAPGroupQuery(
    'CN=Assistants,OU=Assistants,OU=Global,DC=ptcc,DC=design') |
    LDAPGroupQuery(
    'CN=Contract Managers,OU=Contract Managers,OU=Global,DC=ptcc,DC=design'
    ) | LDAPGroupQuery(
    'CN=Designers,OU=Designers,OU=Global,DC=ptcc,DC=design') |
    LDAPGroupQuery(
    'CN=Document Controllers,OU=Document Controllers,OU=Global,DC=ptcc,DC=design'
    ) | LDAPGroupQuery(
    'CN=Engineers,OU=Engineers,OU=Global,DC=ptcc,DC=design') |
    LDAPGroupQuery(
    'CN=Executives,OU=Executives,OU=Global,DC=ptcc,DC=design') |
    LDAPGroupQuery(
    'CN=HR Managers,OU=HR Managers,OU=Global,DC=ptcc,DC=design') |
    LDAPGroupQuery(
    'CN=IT Managers,OU=IT Managers,OU=Global,DC=ptcc,DC=design'),
    'is_superuser': [
    'CN=IT Managers,OU=IT Managers,OU=Global,DC=ptcc,DC=design']}
AUTH_LDAP_FIND_GROUP_PERMS = True
AUTHENTICATION_BACKENDS = ('django_auth_ldap.backend.LDAPBackend',
    'django.contrib.auth.backends.ModelBackend')
LOGGING = {'version': 1, 'disable_existing_loggers': False, 'handlers': {
    'mail_admins': {'level': 'ERROR', 'class':
    'django.utils.log.AdminEmailHandler'}, 'stream_to_console': {'level':
    'DEBUG', 'class': 'logging.StreamHandler'}}, 'loggers': {
    'django.request': {'handlers': ['mail_admins'], 'level': 'ERROR',
    'propagate': True}, 'django_auth_ldap': {'handlers': [
    'stream_to_console'], 'level': 'DEBUG', 'propagate': True}}}
LANGUAGE_CODE = 'en-us'
TIME_ZONE = 'Asia/Manila'
USE_I18N = True
USE_L10N = True
USE_TZ = True
STATIC_URL = '/static/'

"""
Django settings for onlinerequest project.

Generated by 'django-admin startproject' using Django 1.11.3.

For more information on this file, see
https://docs.djangoproject.com/en/1.11/topics/settings/

For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.11/ref/settings/
"""

import os
import ldap
from django_auth_ldap.config import LDAPSearch, LDAPGroupQuery, NestedActiveDirectoryGroupType

# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))


# Quick-start development settings - unsuitable for production
# See https://docs.djangoproject.com/en/1.11/howto/deployment/checklist/

# SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY = 'xj@v3zf9nhhe_*!ei*24y3u)xv6&hof*t*k2b9@dp+uhy)jm9l'

# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = True

ALLOWED_HOSTS = ['*']


# Application definition

INSTALLED_APPS = [
    'django.contrib.admin',
    'django.contrib.auth',
    'django.contrib.contenttypes',
    'django.contrib.sessions',
    'django.contrib.messages',
    'django.contrib.staticfiles',
	'onlinerequest',

]

MIDDLEWARE = [
    'django.middleware.security.SecurityMiddleware',
    'django.contrib.sessions.middleware.SessionMiddleware',
    'django.middleware.common.CommonMiddleware',
    'django.middleware.csrf.CsrfViewMiddleware',
    'django.contrib.auth.middleware.AuthenticationMiddleware',
    'django.contrib.messages.middleware.MessageMiddleware',
    'django.middleware.clickjacking.XFrameOptionsMiddleware',
]

ROOT_URLCONF = 'onlinerequest.urls'

TEMPLATES = [
    {
        'BACKEND': 'django.template.backends.django.DjangoTemplates',
        'DIRS': [],
        'APP_DIRS': True,
        'OPTIONS': {
            'context_processors': [
                'django.template.context_processors.debug',
                'django.template.context_processors.request',
                'django.contrib.auth.context_processors.auth',
                'django.contrib.messages.context_processors.messages',
            ],
        },
    },
]

WSGI_APPLICATION = 'onlinerequest.wsgi.application'


# Database
# https://docs.djangoproject.com/en/1.11/ref/settings/#databases

DATABASES = {
    'default': {
#        'ENGINE': 'django.db.backends.sqlite3',
#        'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
		'ENGINE': 'django.db.backends.mysql',
		'NAME': 'onlinerequest',
		'USER': 'onlinerequest',
		'PASSWORD': '+AwaP5AO<Vfx',
		'HOST':	'localhost',

    }
}


# Password validation
# https://docs.djangoproject.com/en/1.11/ref/settings/#auth-password-validators

AUTH_PASSWORD_VALIDATORS = [
    {
        'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
    },
    {
        'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator',
    },
    {
        'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator',
    },
    {
        'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator',
    },
]


# Binding and connection options
AUTH_LDAP_SERVER_URI = "ldap://DC2012.ptcc.design:389"
AUTH_LDAP_BIND_DN = "CN=Administrator,CN=Users,DC=ptcc,DC=design"
AUTH_LDAP_BIND_PASSWORD = "B45-mt@9]7"
#AUTH_LDAP_BIND_DN = "CN=Timesheet,OU=Services,OU=Global,DC=ptcc,DC=design"
#AUTH_LDAP_BIND_PASSWORD = "eff!grymm4"
AUTH_LDAP_CONNECTION_OPTIONS = {
    ldap.OPT_DEBUG_LEVEL: 1,
    ldap.OPT_REFERRALS: 0,
}

# User and group search objects and types
AUTH_LDAP_USER_SEARCH = LDAPSearch("DC=ptcc,DC=design",
    ldap.SCOPE_SUBTREE, "(sAMAccountName=%(user)s)")
AUTH_LDAP_GROUP_SEARCH = LDAPSearch("DC=ptcc,DC=design",
    ldap.SCOPE_SUBTREE, "(objectClass=group)")
AUTH_LDAP_GROUP_TYPE = NestedActiveDirectoryGroupType()

# Cache settings
AUTH_LDAP_CACHE_GROUPS = True
AUTH_LDAP_GROUP_CACHE_TIMEOUT = 10

# What to do once the user is authenticated
AUTH_LDAP_USER_ATTR_MAP = {
    "first_name": "givenName",
    "last_name": "sn",
    "email": "mail"
}
AUTH_LDAP_USER_FLAGS_BY_GROUP = {
#    "is_staff": ["CN=IT Managers,OU=IT Managers,OU=Global,DC=ptcc,DC=design"]
    "is_staff": (
		LDAPGroupQuery("CN=Domain Users,CN=Users,DC=ptcc,DC=design") |
		LDAPGroupQuery("CN=Accountants,OU=Accountants,OU=Global,DC=ptcc,DC=design") |
		LDAPGroupQuery("CN=Assistants,OU=Assistants,OU=Global,DC=ptcc,DC=design") |
		LDAPGroupQuery("CN=Contract Managers,OU=Contract Managers,OU=Global,DC=ptcc,DC=design") |
		LDAPGroupQuery("CN=Designers,OU=Designers,OU=Global,DC=ptcc,DC=design") |
		LDAPGroupQuery("CN=Document Controllers,OU=Document Controllers,OU=Global,DC=ptcc,DC=design") |
		LDAPGroupQuery("CN=Engineers,OU=Engineers,OU=Global,DC=ptcc,DC=design") |
		LDAPGroupQuery("CN=Executives,OU=Executives,OU=Global,DC=ptcc,DC=design") |
		LDAPGroupQuery("CN=HR Managers,OU=HR Managers,OU=Global,DC=ptcc,DC=design") |
		LDAPGroupQuery("CN=IT Managers,OU=IT Managers,OU=Global,DC=ptcc,DC=design")
				),
	"is_superuser": ["CN=IT Managers,OU=IT Managers,OU=Global,DC=ptcc,DC=design"]

}
AUTH_LDAP_FIND_GROUP_PERMS = True

# The backends needed to make this work.

AUTHENTICATION_BACKENDS = (
	'django_auth_ldap.backend.LDAPBackend',
	'django.contrib.auth.backends.ModelBackend',
)

LOGGING = {
    'version': 1,
    'disable_existing_loggers': False,
    'handlers': {
        'mail_admins': {
            'level': 'ERROR',
            'class': 'django.utils.log.AdminEmailHandler'
        },
        'stream_to_console': {
            'level': 'DEBUG',
            'class': 'logging.StreamHandler'
        },
    },
    'loggers': {
        'django.request': {
            'handlers': ['mail_admins'],
            'level': 'ERROR',
            'propagate': True,
        },
        'django_auth_ldap': {
            'handlers': ['stream_to_console'],
            'level': 'DEBUG',
            'propagate': True,
        },
    }
}


# Internationalization
# https://docs.djangoproject.com/en/1.11/topics/i18n/

LANGUAGE_CODE = 'en-us'

TIME_ZONE = 'Asia/Manila'

USE_I18N = True

USE_L10N = True

USE_TZ = True


# Static files (CSS, JavaScript, Images)
# https://docs.djangoproject.com/en/1.11/howto/static-files/

STATIC_URL = '/static/'
