dev.py 5.73 KB
Newer Older
1 2 3
"""
This config file runs the simplest dev environment"""

4 5
# We intentionally define lots of variables that aren't used, and
# want to import all variables from base settings files
6
# pylint: disable=wildcard-import, unused-wildcard-import
7

8
from .common import *
9
from openedx.core.lib.logsettings import get_logger_config
10

11 12 13
# import settings from LMS for consistent behavior with CMS
from lms.envs.dev import (WIKI_ENABLED)

14 15
DEBUG = True
TEMPLATE_DEBUG = DEBUG
16 17
HTTPS = 'off'

Victor Shnayder committed
18 19 20
LOGGING = get_logger_config(ENV_ROOT / "log",
                            logging_env="dev",
                            tracking_filename="tracking.log",
Calen Pennington committed
21
                            dev_env=True,
Victor Shnayder committed
22 23
                            debug=True)

24 25 26 27 28
update_module_store_settings(
    MODULESTORE,
    module_store_options={
        'default_class': 'xmodule.raw_module.RawDescriptor',
        'fs_root': GITHUB_REPO_ROOT,
29
    }
30
)
31

swdanielli committed
32 33 34 35 36
DJFS = {
    'type': 'osfs',
    'directory_root': 'cms/static/djpyfs',
    'url_root': '/static/djpyfs'
}
swdanielli committed
37

38 39 40 41
# cdodge: This is the specifier for the MongoDB (using GridFS) backed static content store
# This is for static content for courseware, not system static content (e.g. javascript, css, edX branding, etc)
CONTENTSTORE = {
    'ENGINE': 'xmodule.contentstore.mongo.MongoContentStore',
42
    'DOC_STORE_CONFIG': {
43
        'host': 'localhost',
Calen Pennington committed
44
        'db': 'xcontent',
45 46 47 48 49 50
    },
    # allow for additional options that can be keyed on a name, e.g. 'trashcan'
    'ADDITIONAL_OPTIONS': {
        'trashcan': {
            'bucket': 'trash_fs'
        }
51 52 53
    }
}

54 55 56
DATABASES = {
    'default': {
        'ENGINE': 'django.db.backends.sqlite3',
57
        'NAME': ENV_ROOT / "db" / "edx.db",
58
        'ATOMIC_REQUESTS': True,
59 60 61
    }
}

62
LMS_BASE = "localhost:8000"
63
FEATURES['PREVIEW_LMS_BASE'] = "localhost:8000"
64

65 66
REPOS = {
    'edx4edx': {
67
        'branch': 'master',
68 69
        'origin': 'git@github.com:MITx/edx4edx.git',
    },
70 71
    'content-mit-6002x': {
        'branch': 'master',
Don Mitchell committed
72
        # 'origin': 'git@github.com:MITx/6002x-fall-2012.git',
73
        'origin': 'git@github.com:MITx/content-mit-6002x.git',
74 75
    },
    '6.00x': {
76
        'branch': 'master',
77 78 79
        'origin': 'git@github.com:MITx/6.00x.git',
    },
    '7.00x': {
80
        'branch': 'master',
81 82 83
        'origin': 'git@github.com:MITx/7.00x.git',
    },
    '3.091x': {
84
        'branch': 'master',
85 86
        'origin': 'git@github.com:MITx/3.091x.git',
    },
87 88
}

89
CACHES = {
90
    # This is the cache used for most things. Askbot will not work without a
91 92 93 94
    # functioning cache -- it relies on caching to load its settings in places.
    # In staging/prod envs, the sessions also live here.
    'default': {
        'BACKEND': 'django.core.cache.backends.locmem.LocMemCache',
95
        'LOCATION': 'edx_loc_mem_cache',
96 97 98 99 100 101 102 103 104 105 106 107
        'KEY_FUNCTION': 'util.memcache.safe_key',
    },

    # The general cache is what you get if you use our util.cache. It's used for
    # things like caching the course.xml file for different A/B test groups.
    # We set it to be a DummyCache to force reloading of course.xml in dev.
    # In staging environments, we would grab VERSION from data uploaded by the
    # push process.
    'general': {
        'BACKEND': 'django.core.cache.backends.dummy.DummyCache',
        'KEY_PREFIX': 'general',
        'VERSION': 4,
108
        'KEY_FUNCTION': 'util.memcache.safe_key',
109 110 111 112 113 114 115
    },

    'mongo_metadata_inheritance': {
        'BACKEND': 'django.core.cache.backends.filebased.FileBasedCache',
        'LOCATION': '/var/tmp/mongo_metadata_inheritance',
        'TIMEOUT': 300,
        'KEY_FUNCTION': 'util.memcache.safe_key',
116 117 118 119 120
    },
    'loc_cache': {
        'BACKEND': 'django.core.cache.backends.locmem.LocMemCache',
        'LOCATION': 'edx_location_mem_cache',
    },
121 122 123 124
    'course_structure_cache': {
        'BACKEND': 'django.core.cache.backends.locmem.LocMemCache',
        'LOCATION': 'edx_course_structure_mem_cache',
    },
125
}
126 127 128

# Make the keyedcache startup warnings go away
CACHE_TIMEOUT = 0
129 130 131

# Dummy secret key for dev
SECRET_KEY = '85920908f28904ed733fe576320db18cabd7b6cd'
132

133 134
################################ PIPELINE #################################

135
PIPELINE_SASS_ARGUMENTS = '--debug-info'
136

137 138 139 140 141
################################# CELERY ######################################

# By default don't use a worker, execute tasks as if they were local functions
CELERY_ALWAYS_EAGER = True

142
################################ DEBUG TOOLBAR #################################
143
INSTALLED_APPS += ('debug_toolbar', 'debug_toolbar_mongo', 'djpyfs')
Don Mitchell committed
144
MIDDLEWARE_CLASSES += ('debug_toolbar.middleware.DebugToolbarMiddleware',)
145 146 147
INTERNAL_IPS = ('127.0.0.1',)

DEBUG_TOOLBAR_PANELS = (
148 149 150 151 152 153 154 155 156
    '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',
    'debug_toolbar.panels.signals.SignalsPanel',
    'debug_toolbar.panels.logging.LoggingPanel',
    'debug_toolbar.panels.profiling.ProfilingPanel',
157
)
158 159 160

# To see stacktraces for MongoDB queries, set this to True.
# Stacktraces slow down page loads drastically (for pages with lots of queries).
161
DEBUG_TOOLBAR_MONGO_STACKTRACES = False
162

163
# Enable URL that shows information about the status of various services
164
FEATURES['ENABLE_SERVICE_STATUS'] = True
165

166 167
############################# SEGMENT-IO ##################################

168
# If there's an environment variable set, grab it to turn on Segment
169
# Note that this is the Studio key. There is a separate key for the LMS.
pdehaye committed
170
import os
171
CMS_SEGMENT_KEY = os.environ.get('SEGMENT_KEY')
172 173 174 175 176


#####################################################################
# Lastly, see if the developer has any local overrides.
try:
177
    from .private import *  # pylint: disable=import-error
178 179
except ImportError:
    pass