dev.py 5.67 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
Victor Shnayder committed
16 17 18
LOGGING = get_logger_config(ENV_ROOT / "log",
                            logging_env="dev",
                            tracking_filename="tracking.log",
Calen Pennington committed
19
                            dev_env=True,
Victor Shnayder committed
20 21
                            debug=True)

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

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

36 37 38 39
# 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',
40
    'DOC_STORE_CONFIG': {
41
        'host': 'localhost',
Calen Pennington committed
42
        'db': 'xcontent',
43 44 45 46 47 48
    },
    # allow for additional options that can be keyed on a name, e.g. 'trashcan'
    'ADDITIONAL_OPTIONS': {
        'trashcan': {
            'bucket': 'trash_fs'
        }
49 50 51
    }
}

52 53 54
DATABASES = {
    'default': {
        'ENGINE': 'django.db.backends.sqlite3',
55
        'NAME': ENV_ROOT / "db" / "edx.db",
56 57 58
    }
}

59
LMS_BASE = "localhost:8000"
60
FEATURES['PREVIEW_LMS_BASE'] = "localhost:8000"
61

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

86
CACHES = {
87
    # This is the cache used for most things. Askbot will not work without a
88 89 90 91
    # 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',
92
        'LOCATION': 'edx_loc_mem_cache',
93 94 95 96 97 98 99 100 101 102 103 104
        '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,
105
        'KEY_FUNCTION': 'util.memcache.safe_key',
106 107 108 109 110 111 112
    },

    'mongo_metadata_inheritance': {
        'BACKEND': 'django.core.cache.backends.filebased.FileBasedCache',
        'LOCATION': '/var/tmp/mongo_metadata_inheritance',
        'TIMEOUT': 300,
        'KEY_FUNCTION': 'util.memcache.safe_key',
113 114 115 116 117 118
    },
    'loc_cache': {
        'BACKEND': 'django.core.cache.backends.locmem.LocMemCache',
        'LOCATION': 'edx_location_mem_cache',
    },

119
}
120 121 122

# Make the keyedcache startup warnings go away
CACHE_TIMEOUT = 0
123 124 125

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

127 128 129 130
################################ PIPELINE #################################

PIPELINE_SASS_ARGUMENTS = '--debug-info --require {proj_dir}/static/sass/bourbon/lib/bourbon.rb'.format(proj_dir=PROJECT_ROOT)

131 132 133 134 135
################################# CELERY ######################################

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

136
################################ DEBUG TOOLBAR #################################
137
INSTALLED_APPS += ('debug_toolbar', 'debug_toolbar_mongo', 'djpyfs')
Don Mitchell committed
138
MIDDLEWARE_CLASSES += ('debug_toolbar.middleware.DebugToolbarMiddleware',)
139 140 141
INTERNAL_IPS = ('127.0.0.1',)

DEBUG_TOOLBAR_PANELS = (
142 143 144 145 146 147 148 149 150
    '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',
151
)
152 153 154

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

157
# Enable URL that shows information about the status of various services
158
FEATURES['ENABLE_SERVICE_STATUS'] = True
159

160 161
############################# SEGMENT-IO ##################################

162 163
# If there's an environment variable set, grab it and turn on Segment.io
# Note that this is the Studio key. There is a separate key for the LMS.
pdehaye committed
164
import os
165 166
SEGMENT_IO_KEY = os.environ.get('SEGMENT_IO_KEY')
if SEGMENT_IO_KEY:
167
    FEATURES['SEGMENT_IO'] = True
168 169 170 171 172


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