Timing instrumentation
[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 ########## DATABASE CONFIGURATION
28 # See: https://docs.djangoproject.com/en/dev/ref/settings/#databases
29 DATABASES = {
30     'default': {
31         'ENGINE': 'django.db.backends.postgresql_psycopg2',
32         'NAME': 'karmanotes',
33         'USER': 'djkarma',
34         'PASSWORD': 'karma',
35         'HOST': 'localhost',
36         'PORT': '',  # Set to empty string for default. Not used with sqlite3.
37     }
38 }
39 ########## END DATABASE CONFIGURATION
40
41 ########## STATIC CONFIG
42 # See: https://docs.djangoproject.com/en/dev/ref/settings/#static-url
43 STATIC_URL = '/static/'
44 # See: https://docs.djangoproject.com/en/dev/ref/settings/#static-root
45 STATIC_ROOT = normpath(join(DJANGO_ROOT, 'static'))
46
47 ########## END STATIC CONFIG
48
49 ########## CELERY CONFIGURATION
50 # See: http://docs.celeryq.org/en/latest/configuration.html#celery-always-eager
51 CELERY_ALWAYS_EAGER = True
52 ########## END CELERY CONFIGURATION
53
54 ########## STORAGE CONFIGURATION
55 # See: http://django-storages.readthedocs.org/en/latest/index.html
56 INSTALLED_APPS += (
57     'storages',
58 )
59
60 # See: http://django-storages.readthedocs.org/en/latest/backends/amazon-S3.html#settings
61 AWS_CALLING_FORMAT = CallingFormat.SUBDOMAIN
62
63 # AWS cache settings, don't change unless you know what you're doing:
64 AWS_EXPIREY = 60 * 60 * 24 * 7
65 AWS_HEADERS = {
66     'Cache-Control': 'max-age=%d, s-maxage=%d, must-revalidate' % (AWS_EXPIREY,
67         AWS_EXPIREY)
68 }
69 ########## END STORAGE CONFIGURATION
70
71
72 ########## TOOLBAR CONFIGURATION
73 # See: https://github.com/django-debug-toolbar/django-debug-toolbar#installation
74 INSTALLED_APPS += (
75     'debug_toolbar',
76     'template_timings_panel',
77     'django_extensions',
78     'django_nose',
79 )
80
81 DEBUG_TOOLBAR_PANELS = (
82     'debug_toolbar.panels.versions.VersionsPanel',
83     'debug_toolbar.panels.timer.TimerPanel',
84     'debug_toolbar.panels.settings.SettingsPanel',
85     'debug_toolbar.panels.headers.HeadersPanel',
86     'debug_toolbar.panels.request.RequestPanel',
87     'debug_toolbar.panels.sql.SQLPanel',
88     'debug_toolbar.panels.staticfiles.StaticFilesPanel',
89     'debug_toolbar.panels.templates.TemplatesPanel',
90     'template_timings_panel.panels.TemplateTimings.TemplateTimings',
91     'debug_toolbar.panels.cache.CachePanel',
92     'debug_toolbar.panels.signals.SignalsPanel',
93     'debug_toolbar.panels.logging.LoggingPanel',
94 )
95
96 # See: https://github.com/django-debug-toolbar/django-debug-toolbar#installation
97 INTERNAL_IPS = ('127.0.0.1',)
98
99 # See: https://github.com/django-debug-toolbar/django-debug-toolbar#installation
100 MIDDLEWARE_CLASSES += (
101     'debug_toolbar.middleware.DebugToolbarMiddleware',
102 )
103 ########## END TOOLBAR CONFIGURATION
104
105 ########## PROFILING CONFIGURATION
106 MIDDLEWARE_CLASSES += (
107     'karmaworld.apps.courses.middleware.ProfileMiddleware',
108 )
109 ########## END PROFILING CONFIGURATION
110
111 ########## COMPRESSION CONFIGURATION
112 COMPRESS_ENABLED = False
113 ########## END COMPRESSION CONFIGURATION
114
115
116 ########## TESTING CONFIGURATION
117 # Use django-nose to test our app, see https://github.com/jbalogh/django-nose
118 TEST_RUNNER = 'django_nose.NoseTestSuiteRunner'
119 ########## END TESTING CONFIGURATION