1 # Django settings for web project.
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)
16 TEMPLATE_DEBUG = DEBUG
19 ('W. Trevor King', 'wking@drexel.edu'),
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.
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
43 TIME_ZONE = None # 'America/New_York'
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'
51 # If you set this to False, Django will make some optimizations so as not
52 # to load the internationalization machinery.
55 # If you set this to False, Django will not format dates, numbers and
56 # calendars according to the current locale
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')
63 # URL that handles the media served from MEDIA_ROOT. Make sure to use a
65 # Examples: "http://media.lawrence.com/media/", "http://example.com/media/"
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/"
74 # URL prefix for static files.
75 # Example: "http://media.lawrence.com/static/"
76 STATIC_URL = '/static/'
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/admin/'
83 # Additional locations of static files
85 # Put strings here, like "/home/html/static" or "C:/www/django/static".
86 # Always use forward slashes, even on Windows.
87 # Don't forget to use absolute paths, not relative paths.
88 os.path.join(DATA_DIRECTORY, 'media'),
89 os.path.join(DATA_DIRECTORY, 'static'),
92 # List of finder classes that know how to find static files in
94 STATICFILES_FINDERS = (
95 'django.contrib.staticfiles.finders.FileSystemFinder',
96 'django.contrib.staticfiles.finders.AppDirectoriesFinder',
97 # 'django.contrib.staticfiles.finders.DefaultStorageFinder',
100 # Make this unique, and don't share it with anybody.
101 SECRET_KEY = 'wq-)fb$0kv*_q%=ufhaqm7$qw(w84=izd7a!nn)5i@@l)!%3x='
103 # List of callables that know how to import templates from various sources.
105 'django.template.loaders.filesystem.Loader',
106 'django.template.loaders.app_directories.Loader',
107 # 'django.template.loaders.eggs.Loader',
110 MIDDLEWARE_CLASSES = (
111 'django.middleware.common.CommonMiddleware',
112 'django.contrib.sessions.middleware.SessionMiddleware',
113 'django.middleware.csrf.CsrfViewMiddleware',
114 'django.contrib.auth.middleware.AuthenticationMiddleware',
115 'django.contrib.messages.middleware.MessageMiddleware',
118 ROOT_URLCONF = 'cookbook.urls'
121 # Put strings here, like "/home/html/django_templates" or "C:/www/django/templates".
122 # Always use forward slashes, even on Windows.
123 # Don't forget to use absolute paths, not relative paths.
124 os.path.join(DATA_DIRECTORY, 'template'),
128 'django.contrib.auth',
129 'django.contrib.contenttypes',
130 'django.contrib.sessions',
131 'django.contrib.sites',
132 'django.contrib.messages',
133 'django.contrib.staticfiles',
134 # Uncomment the next line to enable the admin:
135 'django.contrib.admin',
136 # Uncomment the next line to enable admin documentation:
137 # 'django.contrib.admindocs',
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",
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.
161 'disable_existing_loggers': False,
165 'class': 'django.utils.log.AdminEmailHandler'
170 'handlers': ['mail_admins'],