|
@ -8,44 +8,13 @@ |
|
|
# local_settings.template (COPY HIM TO local_settings.py AND MAKE YOUR |
|
|
# local_settings.template (COPY HIM TO local_settings.py AND MAKE YOUR |
|
|
# NECESSARY CHANGES. |
|
|
# NECESSARY CHANGES. |
|
|
# |
|
|
# |
|
|
|
|
|
|
|
|
import os |
|
|
|
|
|
import ldap |
|
|
|
|
|
import logging |
|
|
import logging |
|
|
|
|
|
from local_settings import * |
|
|
from django_auth_ldap.config import LDAPSearch, GroupOfNamesType |
|
|
|
|
|
|
|
|
|
|
|
BASE_DIR = os.path.abspath(os.path.dirname(__file__) + '../..') |
|
|
|
|
|
PROJECT_DIR = BASE_DIR + '/sigi' |
|
|
|
|
|
|
|
|
|
|
|
DEBUG = True |
|
|
DEBUG = True |
|
|
TEMPLATE_DEBUG = DEBUG |
|
|
TEMPLATE_DEBUG = DEBUG |
|
|
|
|
|
|
|
|
# I can't determine this, use local_settings.py. |
|
|
|
|
|
ADMINS = (('root', 'root@localhost'),) |
|
|
|
|
|
MANAGERS = ADMINS |
|
|
|
|
|
SERVER_EMAIL = 'root@localhost' |
|
|
|
|
|
DEFAULT_FROM_EMAIL = 'noreply@localhost' |
|
|
|
|
|
|
|
|
|
|
|
INTERNAL_IPS = ('127.0.0.1',) |
|
|
INTERNAL_IPS = ('127.0.0.1',) |
|
|
|
|
|
|
|
|
DEFAULT_FROM_EMAIL = 'sesostris@interlegis.leg.br' |
|
|
|
|
|
EMAIL_SUBJECT_PREFIX = u'[SIGI]' |
|
|
|
|
|
EMAIL_HOST = 'smtp.interlegis.leg.br' |
|
|
|
|
|
EMAIL_PORT = 25 |
|
|
|
|
|
EMAIL_HOST_USER = '' |
|
|
|
|
|
EMAIL_HOST_PASSWORD = '' |
|
|
|
|
|
#EMAIL_USE_TLS = True |
|
|
|
|
|
|
|
|
|
|
|
DATABASE_ENGINE = 'postgresql_psycopg2' |
|
|
|
|
|
#DATABASE_ENGINE = 'sqlite3' |
|
|
|
|
|
DATABASE_NAME = 'sigi' |
|
|
|
|
|
#DATABASE_NAME = 'devel.db' |
|
|
|
|
|
DATABASE_USER = 'sigi' |
|
|
|
|
|
DATABASE_PASSWORD = '123456' |
|
|
|
|
|
DATABASE_HOST = 'localhost' |
|
|
|
|
|
DATABASE_PORT = '5432' |
|
|
|
|
|
|
|
|
|
|
|
TIME_ZONE = 'Brazil/East' |
|
|
TIME_ZONE = 'Brazil/East' |
|
|
LANGUAGE_CODE = 'pt-br' |
|
|
LANGUAGE_CODE = 'pt-br' |
|
|
DEFAULT_CHARSET = 'utf-8' |
|
|
DEFAULT_CHARSET = 'utf-8' |
|
@ -58,66 +27,11 @@ MEDIA_ROOT = BASE_DIR + '/media/' |
|
|
MEDIA_URL = '/sigi/media/' |
|
|
MEDIA_URL = '/sigi/media/' |
|
|
ADMIN_MEDIA_PREFIX = '/sigi/admin_media/' |
|
|
ADMIN_MEDIA_PREFIX = '/sigi/admin_media/' |
|
|
|
|
|
|
|
|
# Baseline configuration. |
|
|
|
|
|
AUTH_LDAP_SERVER_URI = "ldap://w2k3dc01.interlegis.gov.br" |
|
|
|
|
|
AUTH_LDAP_BIND_DN = u"cn=sigi-ldap,ou=Usuários de Sistema,ou=Usuários,ou=Interlegis,dc=interlegis,dc=gov,dc=br" |
|
|
|
|
|
AUTH_LDAP_BIND_PASSWORD = "Sigi2609" |
|
|
|
|
|
AUTH_LDAP_USER = u"ou=SINTER,ou=Usuários,ou=Sede,dc=interlegis,dc=gov,dc=br" |
|
|
|
|
|
AUTH_LDAP_USER_SEARCH = LDAPSearch(AUTH_LDAP_USER, ldap.SCOPE_SUBTREE, "(sAMAccountName=%(user)s)") |
|
|
|
|
|
|
|
|
|
|
|
# Set up the basic group parameters. |
|
|
|
|
|
AUTH_LDAP_GROUP = "ou=Grupos Organizacionais,ou=Sede,dc=interlegis,dc=gov,dc=br" |
|
|
|
|
|
AUTH_LDAP_GROUP_SEARCH = LDAPSearch(AUTH_LDAP_GROUP, ldap.SCOPE_SUBTREE, "(objectClass=Group)") |
|
|
|
|
|
AUTH_LDAP_GROUP_TYPE = GroupOfNamesType(name_attr="cn") |
|
|
|
|
|
|
|
|
|
|
|
# Only users in this group can log in. |
|
|
|
|
|
#AUTH_LDAP_REQUIRE_GROUP = u"cn=Acesso ao SIGI,ou=Grupos de Permissão,ou=Sede,dc=interlegis,dc=gov,dc=br" |
|
|
|
|
|
|
|
|
|
|
|
AUTH_LDAP_USER_FLAGS_BY_GROUP = { |
|
|
|
|
|
"is_staff": u"cn=Acesso ao SIGI,ou=Grupos de Permissão,ou=Sede,dc=interlegis,dc=gov,dc=br" |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
# Populate the Django user from the LDAP directory. |
|
|
|
|
|
AUTH_LDAP_USER_ATTR_MAP = { |
|
|
|
|
|
"first_name": "givenName", |
|
|
|
|
|
"last_name": "sn", |
|
|
|
|
|
"email": "userPrincipalName" |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
# Populate the Django user_profile from the LDAP directory. |
|
|
|
|
|
AUTH_LDAP_PROFILE_ATTR_MAP = { |
|
|
|
|
|
"nome_completo": "cn" |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
#AUTH_LDAP_PROFILE_FLAGS_BY_GROUP = { |
|
|
|
|
|
# "is_awesome": "cn=awesome,ou=django,ou=groups,dc=example,dc=com", |
|
|
|
|
|
#} |
|
|
|
|
|
|
|
|
|
|
|
# Use LDAP group membership to calculate group permissions. |
|
|
|
|
|
AUTH_LDAP_FIND_GROUP_PERMS = True |
|
|
|
|
|
AUTH_LDAP_MIRROR_GROUPS = True |
|
|
|
|
|
|
|
|
|
|
|
# Cache group memberships for an hour to minimize LDAP traffic |
|
|
|
|
|
AUTH_LDAP_CACHE_GROUPS = True |
|
|
|
|
|
AUTH_LDAP_GROUP_CACHE_TIMEOUT = 3600 |
|
|
|
|
|
|
|
|
|
|
|
AUTH_PROFILE_MODULE = 'servidores.Servidor' |
|
|
|
|
|
|
|
|
|
|
|
# Keep ModelBackend around for per-user permissions and maybe a local superuser. |
|
|
|
|
|
AUTHENTICATION_BACKENDS = ( |
|
|
|
|
|
'django_auth_ldap.backend.LDAPBackend', |
|
|
|
|
|
'django.contrib.auth.backends.ModelBackend', |
|
|
|
|
|
) |
|
|
|
|
|
|
|
|
|
|
|
CACHE_BACKEND = 'locmem://' # Considerar seriamente a possibilidade de usar o memcached |
|
|
CACHE_BACKEND = 'locmem://' # Considerar seriamente a possibilidade de usar o memcached |
|
|
CACHE_MIDDLEWARE_SECONDS = 60 |
|
|
CACHE_MIDDLEWARE_SECONDS = 60 |
|
|
CACHE_MIDDLEWARE_KEY_PREFIX = 'sigi' |
|
|
CACHE_MIDDLEWARE_KEY_PREFIX = 'sigi' |
|
|
CACHE_MIDDLEWARE_ANONYMOUS_ONLY = False |
|
|
CACHE_MIDDLEWARE_ANONYMOUS_ONLY = False |
|
|
|
|
|
|
|
|
# Used to provide a seed in secret-key hashing algorithms. Set this to |
|
|
|
|
|
# a random string in your local_settings.py - the longer, the better. |
|
|
|
|
|
SECRET_KEY = 'set-this-in-your-local_settings.py!' |
|
|
|
|
|
|
|
|
|
|
|
# List of callables that know how to import templates from various sources. |
|
|
# List of callables that know how to import templates from various sources. |
|
|
TEMPLATE_LOADERS = ( |
|
|
TEMPLATE_LOADERS = ( |
|
|
'django.template.loaders.filesystem.load_template_source', |
|
|
'django.template.loaders.filesystem.load_template_source', |
|
@ -178,13 +92,13 @@ INSTALLED_APPS = ( |
|
|
'sigi.apps.financeiro', |
|
|
'sigi.apps.financeiro', |
|
|
) |
|
|
) |
|
|
|
|
|
|
|
|
try: |
|
|
#try: |
|
|
from local_settings import * |
|
|
# from local_settings import * |
|
|
except ImportError: |
|
|
#except ImportError: |
|
|
from warnings import warn |
|
|
# from warnings import warn |
|
|
msg = "You don't have local_settings.py file, using defaults settings." |
|
|
# msg = "You don't have local_settings.py file, using defaults settings." |
|
|
try: |
|
|
# try: |
|
|
# don't work in Python 2.4 or before |
|
|
# # don't work in Python 2.4 or before |
|
|
warn(msg, category=ImportWarning) |
|
|
# warn(msg, category=ImportWarning) |
|
|
except NameError: |
|
|
# except NameError: |
|
|
warn(msg) |
|
|
# warn(msg) |
|
|