# Copyright (C) 2012 FinalsClub Foundation
"""Development settings and globals."""
-
from os.path import join, normpath
+from S3 import CallingFormat
from common import *
########## END EMAIL CONFIGURATION
-########## DATABASE CONFIGURATION
-# See: https://docs.djangoproject.com/en/dev/ref/settings/#databases
-DATABASES = {
- 'default': {
- 'ENGINE': 'django.db.backends.sqlite3',
- 'NAME': normpath(join(DJANGO_ROOT, 'karmaworld.db')),
- 'USER': '',
- 'PASSWORD': '',
- 'HOST': '',
- 'PORT': '',
- }
-}
-########## END DATABASE CONFIGURATION
-
-
-########## CACHE CONFIGURATION
-# See: https://docs.djangoproject.com/en/dev/ref/settings/#caches
-CACHES = {
- 'default': {
- 'BACKEND': 'django.core.cache.backends.memcached.PyLibMCCache',
- }
-}
-########## END CACHE CONFIGURATION
+########## STATIC CONFIG
+# See: https://docs.djangoproject.com/en/dev/ref/settings/#static-url
+STATIC_URL = '/static/'
+# See: https://docs.djangoproject.com/en/dev/ref/settings/#static-root
+STATIC_ROOT = normpath(join(DJANGO_ROOT, 'static'))
+########## END STATIC CONFIG
########## CELERY CONFIGURATION
# See: http://docs.celeryq.org/en/latest/configuration.html#celery-always-eager
CELERY_ALWAYS_EAGER = True
########## END CELERY CONFIGURATION
+########## STORAGE CONFIGURATION
+# See: http://django-storages.readthedocs.org/en/latest/index.html
+INSTALLED_APPS += (
+ 'storages',
+)
+
+# See: http://django-storages.readthedocs.org/en/latest/backends/amazon-S3.html#settings
+AWS_CALLING_FORMAT = CallingFormat.SUBDOMAIN
+
+# AWS cache settings, don't change unless you know what you're doing:
+AWS_EXPIREY = 60 * 60 * 24 * 7
+AWS_HEADERS = {
+ 'Cache-Control': 'max-age=%d, s-maxage=%d, must-revalidate' % (AWS_EXPIREY,
+ AWS_EXPIREY)
+}
+########## END STORAGE CONFIGURATION
+
########## TOOLBAR CONFIGURATION
# See: https://github.com/django-debug-toolbar/django-debug-toolbar#installation
INSTALLED_APPS += (
'debug_toolbar',
+ 'django_extensions',
+ 'django_nose',
+)
+
+DEBUG_TOOLBAR_PATCH_SETTINGS = False
+
+DEBUG_TOOLBAR_PANELS = (
+ '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.staticfiles.StaticFilesPanel',
+ 'debug_toolbar.panels.templates.TemplatesPanel',
+ 'debug_toolbar.panels.cache.CachePanel',
+ 'debug_toolbar.panels.signals.SignalsPanel',
+ 'debug_toolbar.panels.logging.LoggingPanel',
)
# See: https://github.com/django-debug-toolbar/django-debug-toolbar#installation
MIDDLEWARE_CLASSES += (
'debug_toolbar.middleware.DebugToolbarMiddleware',
)
-
-DEBUG_TOOLBAR_CONFIG = {
- 'INTERCEPT_REDIRECTS': False # Don't interrput our redirects!
-}
########## END TOOLBAR CONFIGURATION
+
+########## PROFILING CONFIGURATION
+MIDDLEWARE_CLASSES += (
+ 'karmaworld.apps.courses.middleware.ProfileMiddleware',
+)
+########## END PROFILING CONFIGURATION
+
+########## COMPRESSION CONFIGURATION
+COMPRESS_ENABLED = False
+########## END COMPRESSION CONFIGURATION
+
+
+########## TESTING CONFIGURATION
+# Use django-nose to test our app, see https://github.com/jbalogh/django-nose
+TEST_RUNNER = 'django_nose.NoseTestSuiteRunner'
+########## END TESTING CONFIGURATION