Configuration¶
This section describes any settings which are specific to Google Auth Webapp
Specifying the database¶
The default settings.py file contains a facility to configure the database
by means of environment variables. A variable with a name of the form
DJANGO_DB_<key> will be used to set the DATABASES['default'][<key>]
setting. So, for example, one could set the location of the sqlite database by
setting the DJANGO_DB_NAME environment variable or one could change the
backend by setting DJANGO_DB_BACKEND.
Default settings¶
The default settings are given in the
gauthwebapp.settings.base module:
-
gauthwebapp.settings.base.BASE_DIR= '/usr/src/app'¶ Base directory containing the project. Build paths inside the project via
os.path.join(BASE_DIR, ...).
-
gauthwebapp.settings.base.SECRET_KEY= 'ex561uglj%!8oh*umt3-@2-4yj*&dc8cznob*vmb0!9bryoc-$'¶ The Django secret key is by default set from the environment. If omitted, a system check will complain.
-
gauthwebapp.settings.base.DEBUG= True¶ SECURITY WARNING: don’t run with debug turned on in production!
-
gauthwebapp.settings.base.ALLOWED_HOSTS= []¶ By default, no hosts are allowed.
-
gauthwebapp.settings.base.INSTALLED_APPS= ['django.contrib.admin', 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.messages', 'django.contrib.staticfiles', 'automationcommon', 'ucamwebauth', 'api']¶ Installed applications
-
gauthwebapp.settings.base.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']¶ Installed middleware
-
gauthwebapp.settings.base.ROOT_URLCONF= 'gauthwebapp.urls'¶ Root URL patterns
-
gauthwebapp.settings.base.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']}}]¶ Template loading
-
gauthwebapp.settings.base.WSGI_APPLICATION= 'gauthwebapp.wsgi.application'¶ WSGI
-
gauthwebapp.settings.base.DATABASES= {'default': {'ATOMIC_REQUESTS': False, 'AUTOCOMMIT': True, 'CONN_MAX_AGE': 0, 'ENGINE': 'django.db.backends.postgresql', 'HOST': 'gauth-webapp-db', 'NAME': 'gauth-webapp', 'OPTIONS': {}, 'PASSWORD': 'gauth-webapp_password', 'PORT': '', 'TEST': {'CHARSET': None, 'COLLATION': None, 'MIRROR': None, 'NAME': None}, 'TIME_ZONE': None, 'USER': 'postgres'}}¶ Database configuration. The default settings allow configuration of the database from environment variables. An environment variable named
DJANGO_DB_<key>will override theDATABASES['default'][<key>]setting.
-
gauthwebapp.settings.base.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'}]¶ Password validation
-
gauthwebapp.settings.base.LANGUAGE_CODE= 'en-gb'¶ Internationalization
-
gauthwebapp.settings.base.TIME_ZONE= 'UTC'¶ Internationalization
-
gauthwebapp.settings.base.USE_I18N= True¶ Internationalization
-
gauthwebapp.settings.base.USE_L10N= True¶ Internationalization
-
gauthwebapp.settings.base.USE_TZ= True¶ Internationalization
-
gauthwebapp.settings.base.STATIC_URL= '/static/'¶ Static files (CSS, JavaScript, Images)
-
gauthwebapp.settings.base.AUTHENTICATION_BACKENDS= ['ucamwebauth.backends.RavenAuthBackend', 'django.contrib.auth.backends.ModelBackend']¶ Authentication backends
-
gauthwebapp.settings.base.UCAMWEBAUTH_CREATE_USER= True¶ Allow the autocreation of users who have been successfully authenticated by Raven but do not exist in the local database.
-
gauthwebapp.settings.base.UCAMWEBAUTH_LOGOUT_REDIRECT= 'https://raven.cam.ac.uk/auth/logout.html'¶ Redirect to this URL on log out
-
gauthwebapp.settings.base.UCAMWEBAUTH_NOT_CURRENT= False¶ Allow members who are not current members to log in?