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