dev.py 5.79 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 59 60
    }
}

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

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

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

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

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

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

132 133 134 135
################################ PIPELINE #################################

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

136 137 138 139 140
################################# CELERY ######################################

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

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

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

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

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

165 166
############################# SEGMENT-IO ##################################

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


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