local_settings.py.dist 6.44 KB
Newer Older
1
import os
Kroustouris Stauros's avatar
Kroustouris Stauros committed
2
from django.utils.translation import ugettext as _
3 4 5
BASE_DIR = os.path.dirname(os.path.dirname(__file__))
PROJECT_DIR = os.path.join(BASE_DIR, 'djnro')

6 7
# This should be always False
DEBUG = False
8 9
TEMPLATE_DEBUG = DEBUG

10 11 12 13 14 15
ADMINS = (
    ('admin', 'admin@example.org'),
)

MANAGERS = ADMINS

16 17 18 19
# Hosts/domain names that are valid for this site; required if DEBUG is False
# See https://docs.djangoproject.com/en/1.4/ref/settings/#allowed-hosts
ALLOWED_HOSTS = []

20 21 22
# Make this unique, and don't share it with anybody.
SECRET_KEY = '<put something really random here, eg. %$#%@#$^2312351345#$%3452345@#$%@#$234#@$hhzdavfsdcFDGVFSDGhn>'

23
# Google Maps API key, see https://developers.google.com/maps/documentation/javascript/get-api-key#key
24
GOOGLE_MAPS_API_KEY = 'thisisthelongapikey'
25

Vladimir Mencl's avatar
Vladimir Mencl committed
26 27 28 29 30
# Check for headers indicating the request was received on a secure SSL connection
# Uncomment this if you are running DjNRO behind an HTTP proxy that sets this
# header for SSL connections (and protects it for non-SSL connections).
# SECURE_PROXY_SSL_HEADER = ('X-Forwarded-Protocol', 'https')

31 32 33 34 35 36 37 38 39 40 41 42
DATABASES = {
    'default': {
        'ENGINE': 'django.db.backends.', # Add 'postgresql_psycopg2', 'mysql', 'sqlite3' or 'oracle'.
        'NAME': '',                      # Or path to database file if using sqlite3.
        'USER': '',                      # Not used with sqlite3.
        'PASSWORD': '',                  # Not used with sqlite3.
        'HOST': '',                      # Set to empty string for localhost. Not used with sqlite3.
        'PORT': '',                      # Set to empty string for default. Not used with sqlite3.
        'STORAGE_ENGINE': 'INNODB',
    }
}

43 44
STATIC_URL = '/static/'

45
##### LDAP BACKEND ######
46
EXTRA_AUTHENTICATION_BACKENDS = (
47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94
    # 'django_auth_ldap.backend.LDAPBackend',
)

# LDAP CONFIG

# import ldap
# from django_auth_ldap.config import LDAPSearch, GroupOfNamesType

# AUTH_LDAP_BIND_DN = ""
# AUTH_LDAP_BIND_PASSWORD = ""
# AUTH_LDAP_SERVER_URI = "ldap://foo.bar.org"
# AUTH_LDAP_START_TLS = True
# AUTH_LDAP_USER_SEARCH = LDAPSearch("ou=People, dc=bar, dc=foo", ldap.SCOPE_SUBTREE, "(uid=%(user)s)")

# AUTH_LDAP_USER_ATTR_MAP = {
#       "first_name":"givenName",
#       "last_name": "sn",
#       "email": "mail
#       }

# Set up the basic group parameters.

# AUTH_LDAP_GROUP_SEARCH = LDAPSearch(
#     "ou=Groups,dc=foo,dc=bar,dc=org",ldap.SCOPE_SUBTREE, objectClass=groupOfNames"
# )

# AUTH_LDAP_GROUP_TYPE = GroupOfNamesType()

# AUTH_LDAP_USER_FLAGS_BY_GROUP = {
#     "is_active": "cn=NOC, ou=Groups, dc=foo, dc=bar, dc=org",
#     "is_staff": "cn=staff, ou=Groups, dc=foo, dc=bar, dc=org",
#     "is_superuser": "cn=NOC, ou=Groups,dc=foo, dc=bar, dc=org"
# }


SHIB_AUTH_ENTITLEMENT = 'urn:mace:example.com:pki:user'
SHIB_LOGOUT_URL = 'https://example.com/Shibboleth.sso/Logout'

SERVER_EMAIL = "Example domain eduroam Service <noreply@example.com>"
EMAIL_SUBJECT_PREFIX = "[eduroam] "
ACCOUNT_ACTIVATION_DAYS = 7
NOTIFY_ADMIN_MAILS = ["mail1@example.com", "mail2@example.com"]

#### CACHE BACKEND ####
# For development instances you can deploy the provided dummy cache backend
CACHES = {
    'default': {
        'BACKEND': 'django.core.cache.backends.dummy.DummyCache',
95
        'TIMEOUT': 60,
96 97 98 99 100 101 102
    }
}

# For production instances enable memcache
# CACHES = {
#     'default': {
#         'BACKEND': 'django.core.cache.backends.memcached.MemcachedCache',
103
#         'TIMEOUT': 60, # default is 300
104 105 106 107
#         'LOCATION': '127.0.0.1:11211',
#     }
# }

108 109 110 111 112 113 114
# Local time zone for this installation. Choices can be found here:
# http://en.wikipedia.org/wiki/List_of_tz_zones_by_name
# although not all choices may be available on all operating systems.
# In a Windows environment this must be set to your system time zone.
TIME_ZONE = 'Europe/Athens'


115 116 117 118 119 120
# map center (lat, lng)
MAP_CENTER = (36.97, 23.71)

# Frontend country specific vars, eg. Greece
NRO_COUNTRY_NAME = _('My Country')
# Variable used by context_processor to display the "eduroam | <country_code>" in base.html
Zenon Mousmoulas's avatar
Zenon Mousmoulas committed
121
NRO_COUNTRY_CODE = 'tld'
122 123
# main domain url used in right top icon, eg. http://www.grnet.gr
NRO_DOMAIN_MAIN_URL = "http://www.example.com"
124 125 126
# "provided by" info for footer
NRO_PROV_BY_DICT = {"name": "EXAMPLE NRO TEAM", "url": "http://noc.example.com"}
# social media contact (Use: // to preserve https)
Kroustouris Stauros's avatar
Kroustouris Stauros committed
127
NRO_PROV_SOCIAL_MEDIA_CONTACT = [
128 129
    {"url": "//facebook.com/example.com", "icon":"/static/img/facebook_img.png", "name":"Facebook"},
    {"url": "//twitter.com/example_com", "icon":"/static/img/twitter_img.png", "name":"Twitter"},
Kroustouris Stauros's avatar
Kroustouris Stauros committed
130
]
131

132
# Helpdesk, used in base.html:
133 134 135 136 137 138 139
NRO_DOMAIN_HELPDESK_DICT = {"name": _("Domain Helpdesk"), 'email':'helpdesk@example.com', 'phone': '12324567890', 'uri': 'helpdesk.example.com'}

#Countries for Realm model:
REALM_COUNTRIES = (
    ('country_2letters', 'Country' ),
)

140
# Shibboleth attribute map
141 142 143 144 145 146 147
SHIB_USERNAME = ['HTTP_EPPN']
SHIB_MAIL = ['mail', 'HTTP_MAIL', 'HTTP_SHIB_INETORGPERSON_MAIL']
SHIB_FIRSTNAME = ['HTTP_SHIB_INETORGPERSON_GIVENNAME']
SHIB_LASTNAME = ['HTTP_SHIB_PERSON_SURNAME']
SHIB_ENTITLEMENT = ['HTTP_SHIB_EP_ENTITLEMENT']

# DJANGO SOCIAL AUTH PLUGIN SETTINGS
Kroustouris Stauros's avatar
Kroustouris Stauros committed
148 149
SOCIAL_AUTH_TWITTER_KEY = ''
SOCIAL_AUTH_TWITTER_SECRET = ''
150

Kroustouris Stauros's avatar
Kroustouris Stauros committed
151 152 153
SOCIAL_AUTH_GOOGLE_OAUTH2_KEY = ''
SOCIAL_AUTH_GOOGLE_OAUTH2_SECRET = ''
SOCIAL_AUTH_GOOGLE_OAUTH2_SCOPE = []
154

155 156 157 158 159 160 161 162
###### eduroam CAT integration ###########
# In order to enable provisioning to CAT, you must list at least one instance and the
# corresponding description in CAT_INSTANCES. Beware that pages accessible by end users
# currently only show CAT information for the instance named 'production'.
# You must also set the following parameters for each CAT instance in CAT_AUTH:
# CAT_API_KEY: API key for authentication to CAT
# CAT_API_URL: API endpoint URL
# CAT_PROFILES_URL: Base URL for Intitution Download Area pages
163
# CAT_IDPMGMT_URL: URL For IdP Overview page
164 165 166 167 168

# CAT_INSTANCES = (
#     ('production', 'cat.eduroam.org'),
#     ('testing', 'cat-test.eduroam.org'),
# )
169

170 171 172 173 174
# CAT_AUTH = {
#     'production': {
#         "CAT_API_KEY": "<provided API key>",
#         "CAT_API_URL": "https://cat.eduroam.org/admin/API.php",
#         "CAT_PROFILES_URL": "https://cat.eduroam.org/",
175
#         "CAT_IDPMGMT_URL": "https://cat.eduroam.org/admin/overview_idp.php"
176 177 178 179 180
#     },
#     'testing': {
#         "CAT_API_KEY": "<provided API key>",
#         "CAT_API_URL": "https://cat-test.eduroam.org/test/admin/API.php",
#         "CAT_PROFILES_URL": "https://cat-test.eduroam.org/test",
181
#         "CAT_IDPMGMT_URL": "https://cat-test.eduroam.org/test/admin/overview_idp.php"
182 183
#     },
# }