3a2a28adce4d513e44f16b6c019f03aa90618e4b
[django-tables2.git] / example / settings.py
1 # import django_tables
2 from os.path import dirname, join, abspath
3 import sys
4
5
6 ROOT = dirname(abspath(__file__))
7
8
9 sys.path.insert(0, join(ROOT, '..'))
10 import django_tables
11 sys.path.pop(0)
12
13
14 DEBUG = True
15 TEMPLATE_DEBUG = DEBUG
16
17 ADMINS = (
18     # ('Your Name', 'your_email@example.com'),
19 )
20
21 MANAGERS = ADMINS
22
23 DATABASES = {
24     'default': {
25         'ENGINE': 'django.db.backends.sqlite3', # Add 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'.
26         'NAME': join(ROOT, 'database.sqlite'),  # Or path to database file if using sqlite3.
27         'USER': '',                      # Not used with sqlite3.
28         'PASSWORD': '',                  # Not used with sqlite3.
29         'HOST': '',                      # Set to empty string for localhost. Not used with sqlite3.
30         'PORT': '',                      # Set to empty string for default. Not used with sqlite3.
31     }
32 }
33
34 # Local time zone for this installation. Choices can be found here:
35 # http://en.wikipedia.org/wiki/List_of_tz_zones_by_name
36 # although not all choices may be available on all operating systems.
37 # On Unix systems, a value of None will cause Django to use the same
38 # timezone as the operating system.
39 # If running in a Windows environment this must be set to the same as your
40 # system time zone.
41 TIME_ZONE = 'America/Chicago'
42
43 # Language code for this installation. All choices can be found here:
44 # http://www.i18nguy.com/unicode/language-identifiers.html
45 LANGUAGE_CODE = 'en-us'
46
47 SITE_ID = 1
48
49 # If you set this to False, Django will make some optimizations so as not
50 # to load the internationalization machinery.
51 USE_I18N = True
52
53 # If you set this to False, Django will not format dates, numbers and
54 # calendars according to the current locale
55 USE_L10N = True
56
57 # Absolute filesystem path to the directory that will hold user-uploaded files.
58 # Example: "/home/media/media.lawrence.com/media/"
59 MEDIA_ROOT = ''
60
61 # URL that handles the media served from MEDIA_ROOT. Make sure to use a
62 # trailing slash.
63 # Examples: "http://media.lawrence.com/media/", "http://example.com/media/"
64 MEDIA_URL = ''
65
66 # Absolute path to the directory static files should be collected to.
67 # Don't put anything in this directory yourself; store your static files
68 # in apps' "static/" subdirectories and in STATICFILES_DIRS.
69 # Example: "/home/media/media.lawrence.com/static/"
70 STATIC_ROOT = ''
71
72 # URL prefix for static files.
73 # Example: "http://media.lawrence.com/static/"
74 STATIC_URL = '/static/'
75
76 # URL prefix for admin static files -- CSS, JavaScript and images.
77 # Make sure to use a trailing slash.
78 # Examples: "http://foo.com/static/admin/", "/static/admin/".
79 ADMIN_MEDIA_PREFIX = '/static/admin/'
80
81 # Additional locations of static files
82 STATICFILES_DIRS = (
83     # Put strings here, like "/home/html/static" or "C:/www/django/static".
84     # Always use forward slashes, even on Windows.
85     # Don't forget to use absolute paths, not relative paths.
86 )
87
88 # List of finder classes that know how to find static files in
89 # various locations.
90 STATICFILES_FINDERS = (
91     'django.contrib.staticfiles.finders.FileSystemFinder',
92     'django.contrib.staticfiles.finders.AppDirectoriesFinder',
93 #    'django.contrib.staticfiles.finders.DefaultStorageFinder',
94 )
95
96 # Make this unique, and don't share it with anybody.
97 SECRET_KEY = '=nzw@mkqk)tz+_#vf%li&8sn7yn8z7!2-4njuyf1rxs*^muhvh'
98
99 # List of callables that know how to import templates from various sources.
100 TEMPLATE_LOADERS = (
101     'django.template.loaders.filesystem.Loader',
102     'django.template.loaders.app_directories.Loader',
103 #     'django.template.loaders.eggs.Loader',
104 )
105
106 TEMPLATE_CONTEXT_PROCESSORS = (
107     "django.contrib.auth.context_processors.auth",
108     "django.core.context_processors.debug",
109     "django.core.context_processors.i18n",
110     "django.core.context_processors.media",
111     "django.core.context_processors.static",
112     "django.contrib.messages.context_processors.messages",
113     "django.core.context_processors.request",
114 )
115
116 MIDDLEWARE_CLASSES = (
117     'django.middleware.common.CommonMiddleware',
118     'django.contrib.sessions.middleware.SessionMiddleware',
119     'django.middleware.csrf.CsrfViewMiddleware',
120     'django.contrib.auth.middleware.AuthenticationMiddleware',
121     'django.contrib.messages.middleware.MessageMiddleware',
122 )
123
124 ROOT_URLCONF = 'example.urls'
125
126 TEMPLATE_DIRS = (
127     join(ROOT, 'templates'),
128 )
129
130 INSTALLED_APPS = (
131     'django.contrib.admin',
132     'django.contrib.auth',
133     'django.contrib.contenttypes',
134     'django.contrib.sessions',
135     'django.contrib.sites',
136     'django.contrib.messages',
137     'django.contrib.staticfiles',
138     'example.app',
139     'django_tables',
140 )
141
142 # A sample logging configuration. The only tangible logging
143 # performed by this configuration is to send an email to
144 # the site admins on every HTTP 500 error.
145 # See http://docs.djangoproject.com/en/dev/topics/logging for
146 # more details on how to customize your logging configuration.
147 LOGGING = {
148     'version': 1,
149     'disable_existing_loggers': False,
150     'handlers': {
151         'mail_admins': {
152             'level': 'ERROR',
153             'class': 'django.utils.log.AdminEmailHandler'
154         }
155     },
156     'loggers': {
157         'django.request': {
158             'handlers': ['mail_admins'],
159             'level': 'ERROR',
160             'propagate': True,
161         },
162     }
163 }