2015-10-16 17:53:02 +00:00
|
|
|
import os
|
2017-03-26 04:37:30 +00:00
|
|
|
import saml2
|
|
|
|
import saml2.saml
|
2017-03-05 05:58:32 +00:00
|
|
|
from django.utils.crypto import get_random_string
|
2015-10-16 17:53:02 +00:00
|
|
|
|
|
|
|
PROJECT_ROOT = os.path.abspath(os.path.join(os.path.dirname(__file__), os.pardir))
|
|
|
|
PACKAGE_ROOT = os.path.abspath(os.path.dirname(__file__))
|
|
|
|
BASE_DIR = PACKAGE_ROOT
|
|
|
|
|
|
|
|
|
2017-03-31 03:53:30 +00:00
|
|
|
### USER SETTINGS
|
|
|
|
|
|
|
|
DEBUG = True
|
2015-10-16 17:53:02 +00:00
|
|
|
DATABASES = {
|
2017-03-05 04:55:59 +00:00
|
|
|
"default": {
|
|
|
|
"ENGINE": "django.db.backends.sqlite3",
|
|
|
|
"NAME": os.path.join(PROJECT_ROOT, "dev.db"),
|
2016-03-30 04:13:50 +00:00
|
|
|
}
|
2015-10-16 17:53:02 +00:00
|
|
|
}
|
2017-03-31 03:53:30 +00:00
|
|
|
EMAIL_BACKEND = "django.core.mail.backends.console.EmailBackend"
|
|
|
|
THEME_CONTACT_EMAIL = "team@lca2018.org"
|
|
|
|
SECRET_KEY = os.environ.get("DJANGO_SECRET_KEY", get_random_string(length=64))
|
|
|
|
|
|
|
|
|
|
|
|
PINAX_STRIPE_PUBLIC_KEY = os.environ.get("STRIPE_PUBLIC_KEY", "your test public key")
|
|
|
|
PINAX_STRIPE_SECRET_KEY = os.environ.get("STRIPE_SECRET_KEY", "your test secret key")
|
|
|
|
PINAX_STRIPE_SEND_EMAIL_RECEIPTS = False
|
|
|
|
|
|
|
|
saml2_entityid = 'http://example.com/saml2/metadata/'
|
|
|
|
saml2_sp_name = 'Federated Django sample SP'
|
|
|
|
saml2_sp_assertion_service = 'http://example.com/saml2/acs/'
|
|
|
|
saml2_sp_slo_rdir = 'http://example.com/saml2/ls/'
|
|
|
|
smal2_sp_slo_post = 'http://example.com/saml2/ls/post'
|
|
|
|
saml2_base_dir = os.path.join(PACKAGE_ROOT, 'saml2')
|
|
|
|
saml2_idp_metadata = {
|
|
|
|
'local': [os.path.join(saml2_base_dir, 'remote_metadata.xml')],
|
|
|
|
},
|
|
|
|
saml2_signing_key = os.path.join(saml2_base_dir, 'cert.key')
|
|
|
|
saml2_signing_crt = os.path.join(saml2_base_dir, 'cert.pem')
|
|
|
|
saml2_encr_key = os.path.join(saml2_base_dir, 'enc.key')
|
|
|
|
saml2_encr_crt = os.path.join(saml2_base_dir, 'enc.crt')
|
|
|
|
saml2_contact = [
|
|
|
|
{'given_name': os.environ.get("META_GIVEN_NAME", 'Bastard'),
|
|
|
|
'sur_name': os.environ.get('META_FAM_NAME', 'Operator'),
|
|
|
|
'company': os.environ.get('META_COMPANY', 'Corp1'),
|
|
|
|
'email_address': os.environ.get('META_EMAIL', 'op@example.com'),
|
|
|
|
'contact_type': 'technical'},
|
|
|
|
],
|
|
|
|
|
|
|
|
|
|
|
|
### Standard settings
|
2015-10-16 17:53:02 +00:00
|
|
|
|
2016-09-18 10:40:55 +00:00
|
|
|
CACHES = {
|
|
|
|
'default': {
|
|
|
|
'BACKEND': 'django.core.cache.backends.dummy.DummyCache',
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2017-03-31 03:53:30 +00:00
|
|
|
ALLOWED_HOSTS = ['lca2018.org', '127.0.0.1', 'localhost']
|
2015-10-16 17:53:02 +00:00
|
|
|
|
2017-03-05 05:58:32 +00:00
|
|
|
TIME_ZONE = "Australia/Sydney"
|
2016-09-18 10:40:55 +00:00
|
|
|
DATE_FORMAT = "j F Y"
|
|
|
|
LANGUAGE_CODE = "en-au"
|
2015-10-16 17:53:02 +00:00
|
|
|
|
|
|
|
SITE_ID = int(os.environ.get("SITE_ID", 1))
|
|
|
|
USE_I18N = True
|
|
|
|
USE_L10N = True
|
|
|
|
USE_TZ = True
|
|
|
|
|
|
|
|
MEDIA_ROOT = os.path.join(PACKAGE_ROOT, "site_media", "media")
|
|
|
|
MEDIA_URL = "/site_media/media/"
|
|
|
|
|
2017-03-05 11:40:00 +00:00
|
|
|
STATIC_ROOT = os.path.join(PROJECT_ROOT, "static", "distx")
|
2017-01-16 07:24:21 +00:00
|
|
|
STATIC_URL = "/static/dist/"
|
2015-10-16 17:53:02 +00:00
|
|
|
|
2017-03-05 11:40:00 +00:00
|
|
|
STATICFILES_DIRS = [
|
|
|
|
os.path.join(PROJECT_ROOT, "static", "dist"),
|
|
|
|
]
|
|
|
|
|
2015-10-16 17:53:02 +00:00
|
|
|
STATICFILES_FINDERS = [
|
|
|
|
"django.contrib.staticfiles.finders.FileSystemFinder",
|
|
|
|
"django.contrib.staticfiles.finders.AppDirectoriesFinder",
|
|
|
|
]
|
|
|
|
|
|
|
|
TEMPLATES = [
|
|
|
|
{
|
|
|
|
"BACKEND": "django.template.backends.django.DjangoTemplates",
|
|
|
|
"DIRS": [
|
|
|
|
os.path.join(PACKAGE_ROOT, "templates"),
|
|
|
|
],
|
|
|
|
"APP_DIRS": True,
|
|
|
|
"OPTIONS": {
|
|
|
|
"debug": DEBUG,
|
|
|
|
"context_processors": [
|
|
|
|
"django.contrib.auth.context_processors.auth",
|
2017-03-30 12:19:24 +00:00
|
|
|
"django.template.context_processors.debug",
|
|
|
|
"django.template.context_processors.i18n",
|
|
|
|
"django.template.context_processors.media",
|
|
|
|
"django.template.context_processors.static",
|
|
|
|
"django.template.context_processors.tz",
|
|
|
|
"django.template.context_processors.request",
|
2015-10-16 17:53:02 +00:00
|
|
|
"django.contrib.messages.context_processors.messages",
|
|
|
|
"pinax_theme_bootstrap.context_processors.theme",
|
|
|
|
"symposion.reviews.context_processors.reviews",
|
|
|
|
],
|
|
|
|
},
|
|
|
|
},
|
|
|
|
]
|
|
|
|
|
|
|
|
MIDDLEWARE_CLASSES = [
|
|
|
|
"django.contrib.sessions.middleware.SessionMiddleware",
|
|
|
|
"django.middleware.common.CommonMiddleware",
|
|
|
|
"django.middleware.csrf.CsrfViewMiddleware",
|
|
|
|
"django.contrib.auth.middleware.AuthenticationMiddleware",
|
|
|
|
"django.contrib.auth.middleware.SessionAuthenticationMiddleware",
|
|
|
|
"django.contrib.messages.middleware.MessageMiddleware",
|
2017-02-17 07:36:58 +00:00
|
|
|
"debug_toolbar.middleware.DebugToolbarMiddleware",
|
2015-10-16 17:53:02 +00:00
|
|
|
"reversion.middleware.RevisionMiddleware",
|
|
|
|
"django.middleware.clickjacking.XFrameOptionsMiddleware",
|
2016-06-29 13:17:15 +00:00
|
|
|
'pinaxcon.monkey_patch.MonkeyPatchMiddleware',
|
2015-10-16 17:53:02 +00:00
|
|
|
]
|
|
|
|
|
|
|
|
ROOT_URLCONF = "pinaxcon.urls"
|
|
|
|
|
|
|
|
# Python dotted path to the WSGI application used by Django's runserver.
|
|
|
|
WSGI_APPLICATION = "pinaxcon.wsgi.application"
|
|
|
|
|
|
|
|
INSTALLED_APPS = [
|
|
|
|
"django.contrib.admin",
|
|
|
|
"django.contrib.auth",
|
|
|
|
"django.contrib.contenttypes",
|
|
|
|
"django.contrib.messages",
|
|
|
|
"django.contrib.sessions",
|
|
|
|
"django.contrib.sites",
|
|
|
|
"django.contrib.staticfiles",
|
2016-11-23 06:08:00 +00:00
|
|
|
"django.contrib.humanize",
|
2017-02-17 07:36:58 +00:00
|
|
|
"debug_toolbar",
|
2017-01-10 04:12:07 +00:00
|
|
|
|
2017-03-26 04:37:30 +00:00
|
|
|
'djangosaml2',
|
|
|
|
|
2015-10-16 17:53:02 +00:00
|
|
|
# theme
|
|
|
|
"bootstrapform",
|
|
|
|
"pinax_theme_bootstrap",
|
|
|
|
|
|
|
|
# external
|
|
|
|
"easy_thumbnails",
|
|
|
|
"taggit",
|
|
|
|
"reversion",
|
|
|
|
"metron",
|
|
|
|
"sitetree",
|
|
|
|
"pinax.eventlog",
|
2016-06-22 00:07:27 +00:00
|
|
|
|
2015-10-16 17:53:02 +00:00
|
|
|
# symposion
|
|
|
|
"symposion",
|
|
|
|
"symposion.conference",
|
|
|
|
"symposion.proposals",
|
|
|
|
"symposion.reviews",
|
|
|
|
"symposion.schedule",
|
|
|
|
"symposion.speakers",
|
|
|
|
"symposion.teams",
|
|
|
|
|
2016-03-30 04:13:50 +00:00
|
|
|
# Registrasion
|
2016-09-30 10:46:05 +00:00
|
|
|
"registrasion",
|
|
|
|
|
|
|
|
# Registrasion-stipe
|
|
|
|
"pinax.stripe",
|
|
|
|
"django_countries",
|
|
|
|
"registripe",
|
2016-03-30 04:13:50 +00:00
|
|
|
|
2017-03-05 07:34:15 +00:00
|
|
|
# admin - required by registrasion ??
|
2016-09-30 10:46:05 +00:00
|
|
|
"nested_admin",
|
2016-03-30 04:13:50 +00:00
|
|
|
|
2015-10-16 17:53:02 +00:00
|
|
|
# project
|
|
|
|
"pinaxcon",
|
2016-03-30 04:13:50 +00:00
|
|
|
"pinaxcon.proposals",
|
2016-09-30 10:46:05 +00:00
|
|
|
"pinaxcon.registrasion",
|
|
|
|
"jquery",
|
|
|
|
"djangoformsetjs",
|
2016-04-27 00:33:44 +00:00
|
|
|
|
2017-03-05 07:34:15 +00:00
|
|
|
# testing
|
2016-04-27 00:33:44 +00:00
|
|
|
"django_nose",
|
2015-10-16 17:53:02 +00:00
|
|
|
]
|
|
|
|
|
2017-02-17 07:36:58 +00:00
|
|
|
DEBUG_TOOLBAR_PANELS = [
|
|
|
|
'debug_toolbar.panels.versions.VersionsPanel',
|
|
|
|
'debug_toolbar.panels.timer.TimerPanel',
|
|
|
|
'debug_toolbar.panels.settings.SettingsPanel',
|
|
|
|
'debug_toolbar.panels.headers.HeadersPanel',
|
|
|
|
'debug_toolbar.panels.request.RequestPanel',
|
|
|
|
'debug_toolbar.panels.sql.SQLPanel',
|
2017-04-06 08:38:06 +00:00
|
|
|
'debug_toolbar.panels.staticfiles.StaticFilesPanel',
|
2017-02-17 07:36:58 +00:00
|
|
|
'debug_toolbar.panels.cache.CachePanel',
|
|
|
|
'debug_toolbar.panels.signals.SignalsPanel',
|
|
|
|
'debug_toolbar.panels.logging.LoggingPanel',
|
|
|
|
'debug_toolbar.panels.redirects.RedirectsPanel',
|
|
|
|
]
|
|
|
|
|
|
|
|
DEBUG_TOOLBAR_CONFIG = {
|
|
|
|
'INTERCEPT_REDIRECTS': False,
|
2017-03-02 10:06:28 +00:00
|
|
|
'SHOW_TOOLBAR_CALLBACK': lambda x: DEBUG,
|
2017-02-17 07:36:58 +00:00
|
|
|
}
|
2017-01-11 11:58:09 +00:00
|
|
|
|
2015-10-16 17:53:02 +00:00
|
|
|
LOGGING = {
|
2017-01-11 11:58:09 +00:00
|
|
|
'version': 1,
|
|
|
|
'disable_existing_loggers': False,
|
|
|
|
'formatters': {
|
|
|
|
'verbose': {
|
|
|
|
'format': '%(levelname)s %(asctime)s %(module)s %(process)d %(thread)d %(message)s'
|
|
|
|
},
|
|
|
|
'simple': {
|
2017-03-05 05:58:32 +00:00
|
|
|
'format': '%(asctime)s %(levelname)s $(module)s %(message)s'
|
2017-01-11 11:58:09 +00:00
|
|
|
},
|
|
|
|
},
|
|
|
|
'filters': {
|
|
|
|
'require_debug_false': {
|
|
|
|
'()': 'django.utils.log.RequireDebugFalse'
|
2015-10-16 17:53:02 +00:00
|
|
|
}
|
|
|
|
},
|
2017-01-11 11:58:09 +00:00
|
|
|
'handlers': {
|
2017-03-05 07:34:15 +00:00
|
|
|
'console': {
|
2017-01-11 11:58:09 +00:00
|
|
|
'level': 'DEBUG',
|
|
|
|
'class': 'logging.StreamHandler',
|
|
|
|
'formatter': 'simple'
|
|
|
|
},
|
|
|
|
'mail_admins': {
|
|
|
|
'level': 'ERROR',
|
|
|
|
'filters': ['require_debug_false'],
|
|
|
|
'class': 'django.utils.log.AdminEmailHandler',
|
|
|
|
'include_html': True,
|
2015-10-16 17:53:02 +00:00
|
|
|
}
|
|
|
|
},
|
2017-01-11 11:58:09 +00:00
|
|
|
'loggers': {
|
|
|
|
'django.request': {
|
|
|
|
'handlers': ['mail_admins'],
|
|
|
|
'level': 'DEBUG',
|
|
|
|
'propagate': True,
|
2015-10-16 17:53:02 +00:00
|
|
|
},
|
2017-02-04 22:48:38 +00:00
|
|
|
'symposion.request': {
|
|
|
|
'handlers': ['mail_admins'],
|
|
|
|
'level': 'DEBUG',
|
|
|
|
'propagate': True,
|
|
|
|
},
|
2017-01-11 11:58:09 +00:00
|
|
|
},
|
|
|
|
'root': {
|
2017-03-05 05:58:32 +00:00
|
|
|
'handlers': ['console'],
|
2017-01-11 11:58:09 +00:00
|
|
|
'level': 'DEBUG'
|
|
|
|
},
|
2015-10-16 17:53:02 +00:00
|
|
|
}
|
|
|
|
FIXTURE_DIRS = [
|
|
|
|
os.path.join(PROJECT_ROOT, "fixtures"),
|
|
|
|
]
|
|
|
|
|
|
|
|
AUTHENTICATION_BACKENDS = [
|
2017-03-26 04:37:30 +00:00
|
|
|
'symposion.teams.backends.TeamPermissionsBackend',
|
|
|
|
'django.contrib.auth.backends.ModelBackend',
|
|
|
|
'djangosaml2.backends.Saml2Backend',
|
2015-10-16 17:53:02 +00:00
|
|
|
]
|
|
|
|
|
2017-03-26 04:37:30 +00:00
|
|
|
LOGIN_URL = '/saml2/login/'
|
|
|
|
SESSION_EXPIRE_AT_BROWSER_CLOSE = True
|
|
|
|
|
2015-10-16 17:53:02 +00:00
|
|
|
CONFERENCE_ID = 1
|
|
|
|
PROPOSAL_FORMS = {
|
|
|
|
"talk": "pinaxcon.proposals.forms.TalkProposalForm",
|
2016-06-21 11:47:45 +00:00
|
|
|
"tutorial": "pinaxcon.proposals.forms.TutorialProposalForm",
|
|
|
|
"miniconf": "pinaxcon.proposals.forms.MiniconfProposalForm",
|
2016-09-23 11:23:46 +00:00
|
|
|
"sysadmin-miniconf": "pinaxcon.proposals.forms.SysAdminProposalForm",
|
2016-09-26 21:47:05 +00:00
|
|
|
"openradio-miniconf": "pinaxcon.proposals.forms.RadioProposalForm",
|
2016-09-23 11:23:46 +00:00
|
|
|
"wootconf-miniconf": "pinaxcon.proposals.forms.WootconfProposalForm",
|
|
|
|
"writethedocs-miniconf": "pinaxcon.proposals.forms.WriteTheDocsProposalForm",
|
|
|
|
"security-miniconf": "pinaxcon.proposals.forms.SecurityProposalForm",
|
|
|
|
"kernel-miniconf": "pinaxcon.proposals.forms.KernelProposalForm",
|
2016-09-25 05:38:15 +00:00
|
|
|
"games-miniconf": "pinaxcon.proposals.forms.GamesProposalForm",
|
2016-09-27 08:10:41 +00:00
|
|
|
"testing-miniconf": "pinaxcon.proposals.forms.TestingProposalForm",
|
|
|
|
"knowledge-miniconf": "pinaxcon.proposals.forms.KnowledgeProposalForm",
|
|
|
|
"lawpolicy-miniconf": "pinaxcon.proposals.forms.LawProposalForm",
|
2016-12-23 06:29:23 +00:00
|
|
|
"openhardware-miniconf": "pinaxcon.proposals.forms.OpenHardwareProposalForm",
|
2015-10-16 17:53:02 +00:00
|
|
|
}
|
2016-09-23 11:23:46 +00:00
|
|
|
|
2016-09-30 10:46:05 +00:00
|
|
|
# Registrasion bits:
|
|
|
|
ATTENDEE_PROFILE_MODEL = "pinaxcon.registrasion.models.AttendeeProfile"
|
|
|
|
ATTENDEE_PROFILE_FORM = "pinaxcon.registrasion.forms.ProfileForm"
|
|
|
|
INVOICE_CURRENCY = "AUD"
|
|
|
|
|
2016-03-30 04:13:50 +00:00
|
|
|
ATTENDEE_PROFILE_FORM = "pinaxcon.registrasion.forms.ProfileForm"
|
2016-04-27 00:33:44 +00:00
|
|
|
|
2016-07-17 07:52:04 +00:00
|
|
|
# CSRF custom error screen
|
|
|
|
CSRF_FAILURE_VIEW = "pinaxcon.csrf_view.csrf_failure"
|
|
|
|
|
2016-04-27 00:33:44 +00:00
|
|
|
# Use nose to run all tests
|
|
|
|
TEST_RUNNER = 'django_nose.NoseTestSuiteRunner'
|
|
|
|
|
|
|
|
# Tell nose to measure coverage on the 'foo' and 'bar' apps
|
|
|
|
NOSE_ARGS = [
|
|
|
|
'--with-coverage',
|
|
|
|
'--cover-package=registrasion.controllers,registrasion.models',
|
|
|
|
]
|
2016-06-10 03:38:24 +00:00
|
|
|
|
2017-03-26 04:37:30 +00:00
|
|
|
SAML_ATTRIBUTE_MAPPING = {
|
|
|
|
'uid': ('username', ),
|
|
|
|
'mail': ('email', ),
|
|
|
|
'givenName': ('first_name', ),
|
|
|
|
'sn': ('last_name', ),
|
|
|
|
}
|
|
|
|
SAML_CONFIG = {
|
|
|
|
'xmlsec_binary': '/usr/bin/xmlsec1',
|
2017-03-31 03:53:30 +00:00
|
|
|
'entityid': saml2_entityid,
|
|
|
|
'attribute_map_dir': os.path.join(PACKAGE_ROOT, 'saml2/attribute-maps'),
|
2017-03-26 04:37:30 +00:00
|
|
|
'service': {
|
|
|
|
'sp': {
|
2017-03-31 03:53:30 +00:00
|
|
|
'name': saml2_sp_name,
|
2017-03-26 04:37:30 +00:00
|
|
|
'endpoints': {
|
|
|
|
'assertion_consumer_service': [
|
2017-03-31 03:53:30 +00:00
|
|
|
saml2_sp_assertion_service,
|
2017-03-26 04:37:30 +00:00
|
|
|
],
|
|
|
|
'single_logout_service': [
|
2017-03-31 03:53:30 +00:00
|
|
|
(saml2_sp_slo_rdir, saml2.BINDING_HTTP_REDIRECT),
|
|
|
|
(smal2_sp_slo_post, saml2.BINDING_HTTP_POST),
|
2017-03-26 04:37:30 +00:00
|
|
|
],
|
|
|
|
},
|
|
|
|
'logout_requests_signed': True,
|
|
|
|
'required_attributes': ['uid', 'mail', 'givenName', 'sn'],
|
|
|
|
},
|
|
|
|
},
|
2017-03-31 03:53:30 +00:00
|
|
|
'metadata': saml2_idp_metadata,
|
2017-03-26 04:37:30 +00:00
|
|
|
'debug': 1,
|
2017-03-31 03:53:30 +00:00
|
|
|
'key_file': saml2_signing_key,
|
|
|
|
'cert_file': saml2_signing_crt,
|
2017-03-26 04:37:30 +00:00
|
|
|
'encryption_keypairs': [{
|
2017-03-31 03:53:30 +00:00
|
|
|
'key_file': saml2_encr_key,
|
|
|
|
'cert_file': saml2_encr_crt,
|
2017-03-26 04:37:30 +00:00
|
|
|
}],
|
2017-03-31 03:53:30 +00:00
|
|
|
'contact_person': saml2_contact,
|
|
|
|
'valid_for': 10,
|
2017-03-26 04:37:30 +00:00
|
|
|
}
|
|
|
|
|
2017-03-30 08:29:04 +00:00
|
|
|
DEFAULT_FILE_STORAGE = 'gapc_storage.storage.GoogleCloudStorage'
|
|
|
|
GAPC_STORAGE = {
|
|
|
|
'num_retries': 2,
|
|
|
|
}
|