base.py 4.99 KB
Newer Older
1 2 3
"""
Base settings for ORA2.
"""
4

5 6 7 8 9 10 11
import os
import sys

# A little pythonpath munging to let it see things in apps
BASE_DIR = os.path.dirname(os.path.dirname(__file__))
APPS_DIR = os.path.join(BASE_DIR, "apps")

12
sys.path.append(APPS_DIR)  # So it can find the submissions apps dir
13

14 15 16 17
DEBUG = True
TEMPLATE_DEBUG = DEBUG

ADMINS = (
18
    ('admin', 'admin'),
19 20 21 22 23 24
)

MANAGERS = ADMINS

DATABASES = {
    'default': {
25
        'ENGINE': 'django.db.backends.sqlite3', # Add 'postgresql_psycopg2', 'mysql', 'sqlite3' or 'oracle'.
Will Daly committed
26
        'NAME': 'ora2db',                      # Or path to database file if using sqlite3.
27 28 29 30 31 32 33 34 35 36 37 38 39 40
        '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.
    }
}

# 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.
41
TIME_ZONE = 'America/New_York'
42 43 44 45 46 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

# Language code for this installation. All choices can be found here:
# http://www.i18nguy.com/unicode/language-identifiers.html
LANGUAGE_CODE = 'en-us'

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

# If you set this to False, Django will not use timezone-aware datetimes.
USE_TZ = True

# Absolute filesystem path to the directory that will hold user-uploaded files.
# Example: "/home/media/media.lawrence.com/media/"
MEDIA_ROOT = ''

# URL that handles the media served from MEDIA_ROOT. Make sure to use a
# trailing slash.
# Examples: "http://media.lawrence.com/media/", "http://example.com/media/"
MEDIA_URL = ''

# Absolute path to the directory static files should be collected to.
# Don't put anything in this directory yourself; store your static files
# in apps' "static/" subdirectories and in STATICFILES_DIRS.
# Example: "/home/media/media.lawrence.com/static/"
STATIC_ROOT = ''

# URL prefix for static files.
# Example: "http://media.lawrence.com/static/"
STATIC_URL = '/static/'

# Additional locations of static files
STATICFILES_DIRS = (
81 82 83
# Put strings here, like "/home/html/static" or "C:/www/django/static".
# Always use forward slashes, even on Windows.
# Don't forget to use absolute paths, not relative paths.
84 85 86 87 88 89 90
)

# List of finder classes that know how to find static files in
# various locations.
STATICFILES_FINDERS = (
    'django.contrib.staticfiles.finders.FileSystemFinder',
    'django.contrib.staticfiles.finders.AppDirectoriesFinder',
91
    #    'django.contrib.staticfiles.finders.DefaultStorageFinder',
92 93 94 95 96 97 98
)

# Make this unique, and don't share it with anybody.
SECRET_KEY = ')68&-c!+og)cy$o9pju_$c707+fett&ph%t%gqgu-@5)!cl$cr'

# List of callables that know how to import templates from various sources.
TEMPLATE_LOADERS = (
Will Daly committed
99 100
    'django.template.loaders.filesystem.Loader',
    'django.template.loaders.app_directories.Loader',
101 102 103 104 105 106 107 108 109 110 111 112
)

MIDDLEWARE_CLASSES = (
    'django.middleware.common.CommonMiddleware',
    'django.contrib.sessions.middleware.SessionMiddleware',
    'django.middleware.csrf.CsrfViewMiddleware',
    'django.contrib.auth.middleware.AuthenticationMiddleware',
    'django.contrib.messages.middleware.MessageMiddleware',
    # Uncomment the next line for simple clickjacking protection:
    # 'django.middleware.clickjacking.XFrameOptionsMiddleware',
)

113
ROOT_URLCONF = 'urls'
114 115

# Python dotted path to the WSGI application used by Django's runserver.
116
# WSGI_APPLICATION = 'wsgi.application'
117 118 119 120 121 122 123 124

INSTALLED_APPS = (
    'django.contrib.auth',
    'django.contrib.contenttypes',
    'django.contrib.sessions',
    'django.contrib.sites',
    'django.contrib.messages',
    'django.contrib.staticfiles',
125 126
    'django.contrib.admin',
    'django.contrib.admindocs',
127 128 129

    # Third party
    'django_extensions',
130
    'djcelery',
131
    'south',
132 133 134

    # XBlock
    'workbench',
135
    'sample_xblocks.basic',  # Needs to be an app for template lookup
136

Will Daly committed
137
    # ora2 apps
138
    'submissions',
Will Daly committed
139
    'openassessment',
140
    'openassessment.workflow',
141
    'openassessment.assessment',
142 143
)

144
# TODO: add config for XBLOCK_WORKBENCH { SCENARIO_CLASSES }
145 146
WORKBENCH = {
    'reset_state_on_restart': False,
147
}
148 149 150 151 152 153 154

CACHES = {
    'default': {
        'BACKEND': 'django.core.cache.backends.locmem.LocMemCache',
        'LOCATION': 'default_loc_mem',
    },
}
155

156
EDX_ORA2 = {
157

158 159 160 161 162 163 164
}

# Celery configuration
# Note: Version 3.1 of Celery includes Django support, but since we're using
# version 3.0 (same as edx-platform), we need to use an external library.
import djcelery
djcelery.setup_loader()