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

from .common import *
5
from logsettings import get_logger_config
6 7 8

DEBUG = True
TEMPLATE_DEBUG = DEBUG
Victor Shnayder committed
9 10 11
LOGGING = get_logger_config(ENV_ROOT / "log",
                            logging_env="dev",
                            tracking_filename="tracking.log",
Calen Pennington committed
12
                            dev_env=True,
Victor Shnayder committed
13 14
                            debug=True)

15 16 17 18 19 20 21 22 23
modulestore_options = {
    'default_class': 'xmodule.raw_module.RawDescriptor',
    'host': 'localhost',
    'db': 'xmodule',
    'collection': 'modulestore',
    'fs_root': GITHUB_REPO_ROOT,
    'render_template': 'mitxmako.shortcuts.render_to_string',
}

24
MODULESTORE = {
25
    'default': {
26 27 28 29
        'ENGINE': 'xmodule.modulestore.mongo.DraftMongoModuleStore',
        'OPTIONS': modulestore_options
    },
    'direct': {
30
        'ENGINE': 'xmodule.modulestore.mongo.MongoModuleStore',
31
        'OPTIONS': modulestore_options
32
    }
33 34
}

35 36 37 38 39 40
# 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',
    'OPTIONS': {
        'host': 'localhost',
Calen Pennington committed
41
        'db': 'xcontent',
42 43 44 45
    }
}


46 47 48
DATABASES = {
    'default': {
        'ENGINE': 'django.db.backends.sqlite3',
49
        'NAME': ENV_ROOT / "db" / "mitx.db",
50 51 52
    }
}

53
LMS_BASE = "localhost:8000"
54

55 56
REPOS = {
    'edx4edx': {
57
        'branch': 'master',
58 59
        'origin': 'git@github.com:MITx/edx4edx.git',
    },
60 61
    'content-mit-6002x': {
        'branch': 'master',
62 63
        #'origin': 'git@github.com:MITx/6002x-fall-2012.git',
        'origin': 'git@github.com:MITx/content-mit-6002x.git',
64 65
    },
    '6.00x': {
66
        'branch': 'master',
67 68 69
        'origin': 'git@github.com:MITx/6.00x.git',
    },
    '7.00x': {
70
        'branch': 'master',
71 72 73
        'origin': 'git@github.com:MITx/7.00x.git',
    },
    '3.091x': {
74
        'branch': 'master',
75 76
        'origin': 'git@github.com:MITx/3.091x.git',
    },
77 78
}

79
CACHES = {
80
    # This is the cache used for most things. Askbot will not work without a
81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97
    # 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',
        'LOCATION': 'mitx_loc_mem_cache',
        '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,
98
        'KEY_FUNCTION': 'util.memcache.safe_key',
99 100 101 102 103 104 105
    },

    'mongo_metadata_inheritance': {
        'BACKEND': 'django.core.cache.backends.filebased.FileBasedCache',
        'LOCATION': '/var/tmp/mongo_metadata_inheritance',
        'TIMEOUT': 300,
        'KEY_FUNCTION': 'util.memcache.safe_key',
106 107
    }
}
108 109 110

# Make the keyedcache startup warnings go away
CACHE_TIMEOUT = 0
111 112 113

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

115 116 117 118
################################ PIPELINE #################################

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

119 120 121 122 123 124 125 126 127 128 129 130 131 132 133
################################ DEBUG TOOLBAR #################################
INSTALLED_APPS += ('debug_toolbar', 'debug_toolbar_mongo')
MIDDLEWARE_CLASSES += ('django_comment_client.utils.QueryCountDebugMiddleware',
                       'debug_toolbar.middleware.DebugToolbarMiddleware',)
INTERNAL_IPS = ('127.0.0.1',)

DEBUG_TOOLBAR_PANELS = (
    'debug_toolbar.panels.version.VersionDebugPanel',
    'debug_toolbar.panels.timer.TimerDebugPanel',
    'debug_toolbar.panels.settings_vars.SettingsVarsDebugPanel',
    'debug_toolbar.panels.headers.HeaderDebugPanel',
    'debug_toolbar.panels.request_vars.RequestVarsDebugPanel',
    'debug_toolbar.panels.sql.SQLDebugPanel',
    'debug_toolbar.panels.signals.SignalDebugPanel',
    'debug_toolbar.panels.logger.LoggingPanel',
134
    'debug_toolbar_mongo.panel.MongoDebugPanel',
135 136 137 138 139 140 141 142 143 144 145 146 147 148

    #  Enabling the profiler has a weird bug as of django-debug-toolbar==0.9.4 and
    #  Django=1.3.1/1.4 where requests to views get duplicated (your method gets
    #  hit twice). So you can uncomment when you need to diagnose performance
    #  problems, but you shouldn't leave it on.
    #  'debug_toolbar.panels.profiling.ProfilingDebugPanel',
    )

DEBUG_TOOLBAR_CONFIG = {
    'INTERCEPT_REDIRECTS': False
}

# To see stacktraces for MongoDB queries, set this to True.
# Stacktraces slow down page loads drastically (for pages with lots of queries).
149
DEBUG_TOOLBAR_MONGO_STACKTRACES = True
150 151 152

# disable NPS survey in dev mode
MITX_FEATURES['STUDIO_NPS_SURVEY'] = False
153 154

# segment-io key for dev
Mark L. Chang committed
155
SEGMENT_IO_KEY = 'mty8edrrsg'