# Django settings for eduroam project. import os DEBUG = True TEMPLATE_DEBUG = DEBUG here = lambda x: os.path.join(os.path.abspath(os.path.dirname(__file__)), x) ADMINS = ( ('Admin', 'admin@example.com'), ) MANAGERS = ADMINS DATABASES = { 'default': { 'ENGINE': 'django.db.backends.', # Add 'postgresql_psycopg2', 'postgresql', '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', } } # 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. # On Unix systems, a value of None will cause Django to use the same # timezone as the operating system. # If running in a Windows environment this must be set to the same as your # system time zone. TIME_ZONE = 'Europe/Athens' _ = lambda s: s LANGUAGES = ( ('el', _('Greek')), ('en', _('English')), ) # Language code for this installation. All choices can be found here: # http://www.i18nguy.com/unicode/language-identifiers.html LANGUAGE_CODE = 'en' SITE_ID = 1 # If you set this to False, Django will make some optimizations so as not # to load the internationalization machinery. USE_I18N = True # If you set this to False, Django will not format dates, numbers and # calendars according to the current locale USE_L10N = True # Absolute path to the directory that holds media. # Example: "/home/media/media.lawrence.com/" MEDIA_ROOT = '' # URL that handles the media served from MEDIA_ROOT. Make sure to use a # trailing slash if there is a path component (optional in other cases). # Examples: "http://media.lawrence.com", "http://example.com/media/" MEDIA_URL = '' STATIC_URL = '/example/static' # URL prefix for admin media -- CSS, JavaScript and images. Make sure to use a # trailing slash. # Examples: "http://foo.com/media/", "/media/". ADMIN_MEDIA_PREFIX = '/media/' # Make this unique, and don't share it with anybody. SECRET_KEY = 'x)gmuyo2h=l@tmpyh4b(-!gki%@u$-=3^@z+vf&&!ci7$*!+k9' AUTHENTICATION_BACKENDS = ( 'eduroam.djangobackends.shibauthBackend.shibauthBackend', 'eduroam.djangobackends.ldapBackend.ldapBackend', 'social_auth.backends.twitter.TwitterBackend', #'social_auth.backends.facebook.FacebookBackend', 'social_auth.backends.google.GoogleBackend', #'social_auth.backends.contrib.linkedin.LinkedinBackend', #'social_auth.backends.contrib.yahoo.YahooOAuthBackend', #'social_auth.backends.yahoo.YahooBackend', 'social_auth.backends.OpenIDBackend', 'django.contrib.auth.backends.ModelBackend', ) # List of callables that know how to import templates from various sources. TEMPLATE_LOADERS = ( 'django.template.loaders.filesystem.Loader', 'django.template.loaders.app_directories.Loader', # 'django.template.loaders.eggs.Loader', ) TEMPLATE_CONTEXT_PROCESSORS = ( # Required so that RequestContext is passed into # template 'django.core.context_processors.auth', 'django.core.context_processors.debug', 'django.core.context_processors.i18n', 'django.core.context_processors.media', 'django.core.context_processors.request', 'edumanage.context_processors.country_code', 'social_auth.context_processors.social_auth_by_type_backends', ) MIDDLEWARE_CLASSES = ( 'django.middleware.cache.UpdateCacheMiddleware', 'django.middleware.gzip.GZipMiddleware', 'django.middleware.common.CommonMiddleware', 'django.contrib.sessions.middleware.SessionMiddleware', 'django.middleware.locale.LocaleMiddleware', 'django.middleware.csrf.CsrfViewMiddleware', 'django.contrib.auth.middleware.AuthenticationMiddleware', 'django.contrib.messages.middleware.MessageMiddleware', 'django.middleware.cache.FetchFromCacheMiddleware', 'django.contrib.flatpages.middleware.FlatpageFallbackMiddleware', 'edumanage.middleware.WrongBackendExceptionMiddleware', ) ROOT_URLCONF = 'eduroam.urls' TEMPLATE_DIRS = ( "/example/templates" # Put strings here, like "/home/html/django_templates" or "C:/www/django/templates". # Always use forward slashes, even on Windows. # Don't forget to use absolute paths, not relative paths. ) INSTALLED_APPS = ( 'longerusername', 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.sites', 'django.contrib.messages', 'django.contrib.flatpages', 'django.contrib.markup', 'django.contrib.admin', 'django.contrib.admindocs', 'edumanage', 'accounts', 'south', 'registration', 'django_extensions', 'tinymce', 'social_auth', ) AUTH_PROFILE_MODULE = 'accounts.UserProfile' LOGIN_URL = '/login/' KML_FILE = here('all.kml') INST_XML_FILE = here('institution.xml') EDUROAM_KML_URL = 'http://monitor.eduroam.org/kml/all.kml' SHIB_AUTH_ENTITLEMENT = 'urn:mace:example.com:pki:user' SHIB_LOGOUT_URL = 'https://example.com/Shibboleth.sso/Logout' SERVER_EMAIL = "Example domain eduroam Service " EMAIL_SUBJECT_PREFIX = "[eduroam] " ACCOUNT_ACTIVATION_DAYS = 7 NOTIFY_ADMIN_MAILS = ["mail1@example.com", "mail2@example.com"] TINYMCE_JS_URL = '/static/js/tinymce/tiny_mce.js' TINYMCE_DEFAULT_CONFIG = { 'extended_valid_elements' : 'iframe[src|width|height|name|align]', 'plugins': "table,spellchecker,paste,searchreplace", 'theme': "advanced", } CACHE_BACKEND = 'memcached://127.0.0.1:11211/?timeout=5184000' # Frontend country specific vars, eg. Greece NRO_COUNTRY_NAME = _('My Country') # Variable used by context_processor to display the "eduroam | " in base.html NRO_COUNTRY_CODE = 'gr' # main domain url used in right top icon, eg. http://www.grnet.gr NRO_DOMAIN_MAIN_URL = "http://www.example.com" # developer info for footer NRO_DEV_BY_DICT = {"name": "EXAMPLE DEV TEAM", "url": "http://devteam.example.com"} #NRO social media contact (Use: // to preserve https) NRO_DEV_SOCIAL_MEDIA_CONTACT = [ {"url":"//soc.media.url", "icon":"icon.png", "name":"NAME1(eg. Facebook)"}, {"url":"//soc.media.url", "icon":"icon.png", "name":"NAME2(eg. Twitter)"}, ] # map center (lat, lng) MAP_CENTER = (36.97, 23.71) #Helpdesk, used in base.html: NRO_DOMAIN_HELPDESK_DICT = {"name": _("Domain Helpdesk"), 'email':'helpdesk@example.com', 'phone': '12324567890', 'uri': 'helpdesk.example.com'} # Overview LDAP LDAP_AUTH_SETTINGS = ( {'url': 'ldap://ds.example.com', 'base': 'dc=dept,dc=example,dc=com'}, ) # If defined as a string new users will belong in this group. Group must exist LDAP_AUTH_GROUP = None # Whether new users will have admin access LDAP_AUTH_IS_STAFF = False #Shibboleth attribute map 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 TWITTER_CONSUMER_KEY = '' TWITTER_CONSUMER_SECRET = '' FACEBOOK_APP_ID = '' FACEBOOK_API_SECRET = '' LINKEDIN_CONSUMER_KEY = '' LINKEDIN_CONSUMER_SECRET = '' LINKEDIN_SCOPE = ['r_basicprofile', 'r_emailaddress'] LINKEDIN_EXTRA_FIELD_SELECTORS = ['email-address', 'headline', 'industry'] LINKEDIN_EXTRA_DATA = [('id', 'id'), ('first-name', 'first_name'), ('last-name', 'last_name'), ('email-address', 'email_address'), ('headline', 'headline'), ('industry', 'industry')] YAHOO_CONSUMER_KEY = '' YAHOO_CONSUMER_SECRET = '' GOOGLE_SREG_EXTRA_DATA = [] SOCIAL_AUTH_FORCE_POST_DISCONNECT = True FACEBOOK_EXTENDED_PERMISSIONS = ['email'] SOCIAL_AUTH_LOGIN_REDIRECT_URL = '/manage/' LOGIN_REDIRECT_URL = '/manage/' SOCIAL_AUTH_INACTIVE_USER_URL = '/manage/' SOCIAL_AUTH_FORCE_POST_DISCONNECT = True SOCIAL_AUTH_REDIRECT_IS_HTTPS = True SOCIAL_AUTH_CREATE_USERS = True SOCIAL_AUTH_FORCE_RANDOM_USERNAME = False SOCIAL_AUTH_SANITIZE_REDIRECTS = False SOCIAL_AUTH_PIPELINE = ( 'social_auth.backends.pipeline.social.social_auth_user', 'social_auth.backends.pipeline.user.get_username', 'social_auth.backends.pipeline.user.create_user', 'social_auth.backends.pipeline.social.associate_user', 'social_auth.backends.pipeline.social.load_extra_data', 'social_auth.backends.pipeline.user.update_user_details', )