Make ssl redirection a separate config
[oweals/karmaworld.git] / karmaworld / settings / dev.py
1 #!/usr/bin/env python
2 # -*- coding:utf8 -*-
3 # Copyright (C) 2012  FinalsClub Foundation
4 """Development settings and globals."""
5
6 from os.path import join, normpath
7 from S3 import CallingFormat
8
9 from common import *
10
11
12 ########## DEBUG CONFIGURATION
13 # See: https://docs.djangoproject.com/en/dev/ref/settings/#debug
14 DEBUG = True
15
16 # See: https://docs.djangoproject.com/en/dev/ref/settings/#template-debug
17 TEMPLATE_DEBUG = DEBUG
18 ########## END DEBUG CONFIGURATION
19
20
21 ########## EMAIL CONFIGURATION
22 # See: https://docs.djangoproject.com/en/dev/ref/settings/#email-backend
23 EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend'
24 ########## END EMAIL CONFIGURATION
25
26
27 ########## STATIC CONFIG
28 # See: https://docs.djangoproject.com/en/dev/ref/settings/#static-url
29 STATIC_URL = '/static/'
30 # See: https://docs.djangoproject.com/en/dev/ref/settings/#static-root
31 STATIC_ROOT = normpath(join(DJANGO_ROOT, 'static'))
32
33 ########## END STATIC CONFIG
34
35 ########## CELERY CONFIGURATION
36 # See: http://docs.celeryq.org/en/latest/configuration.html#celery-always-eager
37 CELERY_ALWAYS_EAGER = True
38 ########## END CELERY CONFIGURATION
39
40 ########## STORAGE CONFIGURATION
41 # See: http://django-storages.readthedocs.org/en/latest/index.html
42 INSTALLED_APPS += (
43     'storages',
44 )
45
46 # See: http://django-storages.readthedocs.org/en/latest/backends/amazon-S3.html#settings
47 AWS_CALLING_FORMAT = CallingFormat.SUBDOMAIN
48
49 # AWS cache settings, don't change unless you know what you're doing:
50 AWS_EXPIREY = 60 * 60 * 24 * 7
51 AWS_HEADERS = {
52     'Cache-Control': 'max-age=%d, s-maxage=%d, must-revalidate' % (AWS_EXPIREY,
53         AWS_EXPIREY)
54 }
55 ########## END STORAGE CONFIGURATION
56
57
58 ########## TOOLBAR CONFIGURATION
59 # See: https://github.com/django-debug-toolbar/django-debug-toolbar#installation
60 INSTALLED_APPS += (
61     'debug_toolbar',
62     'django_extensions',
63     'django_nose',
64 )
65
66 DEBUG_TOOLBAR_PATCH_SETTINGS = False
67
68 DEBUG_TOOLBAR_PANELS = (
69     'debug_toolbar.panels.versions.VersionsPanel',
70     'debug_toolbar.panels.timer.TimerPanel',
71     'debug_toolbar.panels.settings.SettingsPanel',
72     'debug_toolbar.panels.headers.HeadersPanel',
73     'debug_toolbar.panels.request.RequestPanel',
74     'debug_toolbar.panels.sql.SQLPanel',
75     'debug_toolbar.panels.staticfiles.StaticFilesPanel',
76     'debug_toolbar.panels.templates.TemplatesPanel',
77     'debug_toolbar.panels.cache.CachePanel',
78     'debug_toolbar.panels.signals.SignalsPanel',
79     'debug_toolbar.panels.logging.LoggingPanel',
80 )
81
82 # See: https://github.com/django-debug-toolbar/django-debug-toolbar#installation
83 INTERNAL_IPS = ('127.0.0.1',)
84
85 # See: https://github.com/django-debug-toolbar/django-debug-toolbar#installation
86 MIDDLEWARE_CLASSES += (
87     'debug_toolbar.middleware.DebugToolbarMiddleware',
88 )
89 ########## END TOOLBAR CONFIGURATION
90
91 ########## PROFILING CONFIGURATION
92 MIDDLEWARE_CLASSES += (
93     'karmaworld.apps.courses.middleware.ProfileMiddleware',
94 )
95 ########## END PROFILING CONFIGURATION
96
97 ########## COMPRESSION CONFIGURATION
98 COMPRESS_ENABLED = False
99 ########## END COMPRESSION CONFIGURATION
100
101
102 ########## TESTING CONFIGURATION
103 # Use django-nose to test our app, see https://github.com/jbalogh/django-nose
104 TEST_RUNNER = 'django_nose.NoseTestSuiteRunner'
105 ########## END TESTING CONFIGURATION