devplus.py 2.34 KB
Newer Older
1 2 3
"""
This config file tries to mimic the production environment more closely than the
normal dev.py. It assumes you're running a local instance of MySQL 5.1 and that
4 5
you're running memcached. You'll want to use this to test caching and database
migrations.
6 7

Assumptions:
8
* MySQL 5.1 (version important?  (askbot breaks on 5.5, but that's gone now))
9 10 11 12 13 14

Dir structure:
/envroot/
        /mitx # The location of this repo
        /log  # Where we're going to write log files

15
"""
16 17 18 19 20

# We intentionally define lots of variables that aren't used, and
# want to import all variables from base settings files
# pylint: disable=W0401, W0614

21
from .dev import *
22

23 24
WIKI_ENABLED = True

25 26
DATABASES = {
    'default': {
27 28 29 30 31 32
        'ENGINE': 'django.db.backends.mysql',
        'NAME': 'wwc',
        'USER': 'root',
        'PASSWORD': '',
        'HOST': '127.0.0.1',
        'PORT': '3306',
33 34 35 36 37 38 39
    }
}

CACHES = {
   'default': {
       'BACKEND': 'django.core.cache.backends.memcached.MemcachedCache',
       'LOCATION': '127.0.0.1:11211',
40
       'KEY_FUNCTION': 'util.memcache.safe_key',
41
   },
42 43 44
   'general': {
       'BACKEND': 'django.core.cache.backends.memcached.MemcachedCache',
       'LOCATION': '127.0.0.1:11211',
Calen Pennington committed
45 46
       'KEY_PREFIX': 'general',
       'VERSION': 5,
47
       'KEY_FUNCTION': 'util.memcache.safe_key',
48
   }
49 50 51
}

SESSION_ENGINE = 'django.contrib.sessions.backends.cache'
52 53 54


################################ DEBUG TOOLBAR #################################
Calen Pennington committed
55
INSTALLED_APPS += ('debug_toolbar',)
56 57 58 59 60 61 62 63 64 65 66 67 68 69
MIDDLEWARE_CLASSES += ('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',

#  Enabling the profiler has a weird bug as of django-debug-toolbar==0.9.4 and
Calen Pennington committed
70 71
#  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
72
#  problems, but you shouldn't leave it on.
73
  'debug_toolbar.panels.profiling.ProfilingDebugPanel',
74
)
75 76

#PIPELINE = True