dev.py 5.78 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
LMS_ROOT_URL = "http://{}".format(LMS_BASE)
64
FEATURES['PREVIEW_LMS_BASE'] = "localhost:8000"
65

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

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

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

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

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

134 135
################################ PIPELINE #################################

136
PIPELINE_SASS_ARGUMENTS = '--debug-info'
137

138 139 140 141 142
################################# CELERY ######################################

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

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

DEBUG_TOOLBAR_PANELS = (
149 150 151 152 153 154 155 156 157
    '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',
158
)
159 160 161

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

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

167 168
############################# SEGMENT-IO ##################################

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


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