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/"
72 STATIC_ROOT = os.path.join(DATA_DIRECTORY, '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_URL + 'admin/'
82 ADMIN_MEDIA_PREFIX = STATIC_URL + 'grappelli/'
84 # Additional locations of static files
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.
91 # List of finder classes that know how to find static files in
93 STATICFILES_FINDERS = (
94 'django.contrib.staticfiles.finders.FileSystemFinder',
95 'django.contrib.staticfiles.finders.AppDirectoriesFinder',
96 # 'django.contrib.staticfiles.finders.DefaultStorageFinder',
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='
102 # List of callables that know how to import templates from various sources.
104 'django.template.loaders.filesystem.Loader',
105 'django.template.loaders.app_directories.Loader',
106 # 'django.template.loaders.eggs.Loader',
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',
117 ROOT_URLCONF = 'cookbook.urls'
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.
126 'django.contrib.auth',
127 'django.contrib.contenttypes',
128 'django.contrib.sessions',
129 'django.contrib.sites',
130 'django.contrib.messages',
131 'django.contrib.staticfiles',
132 # Uncomment the next line to enable the admin:
134 'django.contrib.admin',
135 # Uncomment the next line to enable admin documentation:
136 # 'django.contrib.admindocs',
141 # Required for render_table
142 # http://django-tables2.readthedocs.org/en/latest/#render-table
143 TEMPLATE_CONTEXT_PROCESSORS = (
144 "django.contrib.auth.context_processors.auth",
145 "django.core.context_processors.debug",
146 "django.core.context_processors.i18n",
147 "django.core.context_processors.media",
148 "django.core.context_processors.static",
149 "django.contrib.messages.context_processors.messages",
150 "django.core.context_processors.request",
153 # A sample logging configuration. The only tangible logging
154 # performed by this configuration is to send an email to
155 # the site admins on every HTTP 500 error.
156 # See http://docs.djangoproject.com/en/dev/topics/logging for
157 # more details on how to customize your logging configuration.
160 'disable_existing_loggers': False,
164 'class': 'django.utils.log.AdminEmailHandler'
169 'handlers': ['mail_admins'],