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

5
import os
muhammad-ammar committed
6
from celery import Celery
7

8 9 10 11
DEBUG = True
TEMPLATE_DEBUG = DEBUG

ADMINS = (
12
    ('admin', 'admin'),
13 14 15 16 17 18
)

MANAGERS = ADMINS

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

# 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 = (
75 76 77
# 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.
78 79 80 81 82 83 84
)

# 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',
85
    #    'django.contrib.staticfiles.finders.DefaultStorageFinder',
86 87 88 89 90 91 92
)

# 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
93 94
    'django.template.loaders.filesystem.Loader',
    'django.template.loaders.app_directories.Loader',
95 96 97 98 99 100 101 102 103 104 105 106
)

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',
)

107
ROOT_URLCONF = 'urls'
108 109

# Python dotted path to the WSGI application used by Django's runserver.
110
# WSGI_APPLICATION = 'wsgi.application'
111 112 113 114 115 116 117 118

INSTALLED_APPS = (
    'django.contrib.auth',
    'django.contrib.contenttypes',
    'django.contrib.sessions',
    'django.contrib.sites',
    'django.contrib.messages',
    'django.contrib.staticfiles',
119 120
    'django.contrib.admin',
    'django.contrib.admindocs',
121 122 123 124 125 126

    # Third party
    'django_extensions',

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

Will Daly committed
129
    # ora2 apps
130
    'submissions',
Will Daly committed
131
    'openassessment',
132
    'openassessment.fileupload',
133
    'openassessment.workflow',
134
    'openassessment.assessment',
135

136 137
)

138
# TODO: add config for XBLOCK_WORKBENCH { SCENARIO_CLASSES }
139 140
WORKBENCH = {
    'reset_state_on_restart': False,
141
}
142 143 144 145 146 147 148

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

150
BASE_DIR = os.path.abspath(os.path.dirname(os.path.dirname(__file__)))
151

muhammad-ammar committed
152
# Celery initialization and configuration
153

muhammad-ammar committed
154 155 156 157 158 159 160 161 162
class Config:
    # We run Celery in "always eager" mode in the test suite and local dev,
    # which executes tasks synchronously instead of using the task queue.
    CELERY_ALWAYS_EAGER = True
    CELERY_EAGER_PROPAGATES_EXCEPTIONS = True

APP = Celery()
APP.config_from_object(Config)
APP.autodiscover_tasks(lambda: INSTALLED_APPS)