Tony Mack | 7130ac3 | 2013-03-22 21:58:00 -0400 | [diff] [blame] | 1 | # Django settings for planetstack project. |
Tony Mack | e485af3 | 2013-05-10 17:15:32 -0400 | [diff] [blame] | 2 | from config import Config |
| 3 | config = Config() |
Tony Mack | 7130ac3 | 2013-03-22 21:58:00 -0400 | [diff] [blame] | 4 | |
| 5 | DEBUG = True |
| 6 | TEMPLATE_DEBUG = DEBUG |
| 7 | |
| 8 | ADMINS = ( |
| 9 | # ('Your Name', 'your_email@example.com'), |
| 10 | ) |
| 11 | |
| 12 | MANAGERS = ADMINS |
| 13 | |
| 14 | DATABASES = { |
| 15 | 'default': { |
| 16 | 'ENGINE': 'django.db.backends.postgresql_psycopg2', # Add 'postgresql_psycopg2', 'mysql', 'sqlite3' or 'oracle'. |
Tony Mack | e485af3 | 2013-05-10 17:15:32 -0400 | [diff] [blame] | 17 | 'NAME': config.db_name, # Or path to database file if using sqlite3. |
Tony Mack | 7130ac3 | 2013-03-22 21:58:00 -0400 | [diff] [blame] | 18 | # The following settings are not used with sqlite3: |
Tony Mack | e485af3 | 2013-05-10 17:15:32 -0400 | [diff] [blame] | 19 | 'USER': config.db_user, |
| 20 | 'PASSWORD': config.db_password, |
| 21 | 'HOST': config.db_host, # Empty for localhost through domain sockets or '127.0.0.1' for localhost through TCP. |
Tony Mack | 7130ac3 | 2013-03-22 21:58:00 -0400 | [diff] [blame] | 22 | 'PORT': '', # Set to empty string for default. |
| 23 | } |
| 24 | } |
| 25 | |
Siobhan Tully | 30fd429 | 2013-05-10 08:59:56 -0400 | [diff] [blame] | 26 | AUTH_USER_MODEL = 'core.User' |
| 27 | |
Tony Mack | 7130ac3 | 2013-03-22 21:58:00 -0400 | [diff] [blame] | 28 | # Hosts/domain names that are valid for this site; required if DEBUG is False |
| 29 | # See https://docs.djangoproject.com/en/1.5/ref/settings/#allowed-hosts |
| 30 | ALLOWED_HOSTS = [] |
| 31 | |
| 32 | # Local time zone for this installation. Choices can be found here: |
| 33 | # http://en.wikipedia.org/wiki/List_of_tz_zones_by_name |
| 34 | # although not all choices may be available on all operating systems. |
| 35 | # In a Windows environment this must be set to your system time zone. |
| 36 | TIME_ZONE = 'America/New_York' |
| 37 | |
| 38 | # Language code for this installation. All choices can be found here: |
| 39 | # http://www.i18nguy.com/unicode/language-identifiers.html |
| 40 | LANGUAGE_CODE = 'en-us' |
| 41 | |
| 42 | SITE_ID = 1 |
| 43 | |
| 44 | # If you set this to False, Django will make some optimizations so as not |
| 45 | # to load the internationalization machinery. |
| 46 | USE_I18N = True |
| 47 | |
| 48 | # If you set this to False, Django will not format dates, numbers and |
| 49 | # calendars according to the current locale. |
| 50 | USE_L10N = True |
| 51 | |
| 52 | # If you set this to False, Django will not use timezone-aware datetimes. |
| 53 | USE_TZ = True |
| 54 | |
| 55 | # Absolute filesystem path to the directory that will hold user-uploaded files. |
| 56 | # Example: "/var/www/example.com/media/" |
| 57 | MEDIA_ROOT = '' |
| 58 | |
| 59 | # URL that handles the media served from MEDIA_ROOT. Make sure to use a |
| 60 | # trailing slash. |
| 61 | # Examples: "http://example.com/media/", "http://media.example.com/" |
| 62 | MEDIA_URL = '' |
| 63 | |
| 64 | # Absolute path to the directory static files should be collected to. |
| 65 | # Don't put anything in this directory yourself; store your static files |
| 66 | # in apps' "static/" subdirectories and in STATICFILES_DIRS. |
| 67 | # Example: "/var/www/example.com/static/" |
| 68 | STATIC_ROOT = '' |
| 69 | |
| 70 | # URL prefix for static files. |
| 71 | # Example: "http://example.com/static/", "http://static.example.com/" |
| 72 | STATIC_URL = '/static/' |
| 73 | |
| 74 | # Additional locations of static files |
| 75 | STATICFILES_DIRS = ( |
| 76 | # Put strings here, like "/home/html/static" or "C:/www/django/static". |
| 77 | # Always use forward slashes, even on Windows. |
| 78 | # Don't forget to use absolute paths, not relative paths. |
| 79 | ) |
| 80 | |
| 81 | # List of finder classes that know how to find static files in |
| 82 | # various locations. |
| 83 | STATICFILES_FINDERS = ( |
| 84 | 'django.contrib.staticfiles.finders.FileSystemFinder', |
| 85 | 'django.contrib.staticfiles.finders.AppDirectoriesFinder', |
| 86 | # 'django.contrib.staticfiles.finders.DefaultStorageFinder', |
| 87 | ) |
| 88 | |
| 89 | # Make this unique, and don't share it with anybody. |
| 90 | SECRET_KEY = 'i0=a)c7_#2)5m%k_fu#%53xap$tlqc+#&z5as+bl7&)(@be_f9' |
| 91 | |
| 92 | # List of callables that know how to import templates from various sources. |
| 93 | TEMPLATE_LOADERS = ( |
| 94 | 'django.template.loaders.filesystem.Loader', |
| 95 | 'django.template.loaders.app_directories.Loader', |
| 96 | # 'django.template.loaders.eggs.Loader', |
| 97 | ) |
| 98 | |
| 99 | MIDDLEWARE_CLASSES = ( |
| 100 | 'django.middleware.common.CommonMiddleware', |
| 101 | 'django.contrib.sessions.middleware.SessionMiddleware', |
| 102 | 'django.middleware.csrf.CsrfViewMiddleware', |
| 103 | 'django.contrib.auth.middleware.AuthenticationMiddleware', |
| 104 | 'django.contrib.messages.middleware.MessageMiddleware', |
| 105 | # Uncomment the next line for simple clickjacking protection: |
| 106 | # 'django.middleware.clickjacking.XFrameOptionsMiddleware', |
| 107 | ) |
| 108 | |
Siobhan Tully | 30fd429 | 2013-05-10 08:59:56 -0400 | [diff] [blame] | 109 | ROOT_URLCONF = 'planetstack.urls' |
Tony Mack | 7130ac3 | 2013-03-22 21:58:00 -0400 | [diff] [blame] | 110 | |
| 111 | # Python dotted path to the WSGI application used by Django's runserver. |
Siobhan Tully | 30fd429 | 2013-05-10 08:59:56 -0400 | [diff] [blame] | 112 | WSGI_APPLICATION = 'planetstack.wsgi.application' |
Tony Mack | 7130ac3 | 2013-03-22 21:58:00 -0400 | [diff] [blame] | 113 | |
| 114 | TEMPLATE_DIRS = ( |
| 115 | # Put strings here, like "/home/html/django_templates" or "C:/www/django/templates". |
| 116 | # Always use forward slashes, even on Windows. |
| 117 | # Don't forget to use absolute paths, not relative paths. |
Siobhan Tully | 30fd429 | 2013-05-10 08:59:56 -0400 | [diff] [blame] | 118 | "/opt/planetstack/templates" |
Tony Mack | 7130ac3 | 2013-03-22 21:58:00 -0400 | [diff] [blame] | 119 | ) |
| 120 | |
| 121 | INSTALLED_APPS = ( |
| 122 | 'django.contrib.auth', |
| 123 | 'django.contrib.contenttypes', |
| 124 | 'django.contrib.sessions', |
| 125 | # 'django.contrib.sites', |
| 126 | 'django.contrib.messages', |
| 127 | 'django.contrib.staticfiles', |
| 128 | # Uncomment the next line to enable the admin: |
| 129 | 'django.contrib.admin', |
| 130 | # Uncomment the next line to enable admin documentation: |
| 131 | 'django.contrib.admindocs', |
| 132 | 'rest_framework', |
| 133 | 'django_extensions', |
Tony Mack | 7130ac3 | 2013-03-22 21:58:00 -0400 | [diff] [blame] | 134 | 'django_evolution', |
Siobhan Tully | bf1153a | 2013-05-27 20:53:48 -0400 | [diff] [blame] | 135 | 'core', |
Siobhan Tully | 567e3e6 | 2013-06-21 18:03:16 -0400 | [diff] [blame] | 136 | 'geoposition' |
Tony Mack | 7130ac3 | 2013-03-22 21:58:00 -0400 | [diff] [blame] | 137 | ) |
| 138 | |
| 139 | # A sample logging configuration. The only tangible logging |
| 140 | # performed by this configuration is to send an email to |
| 141 | # the site admins on every HTTP 500 error when DEBUG=False. |
| 142 | # See http://docs.djangoproject.com/en/dev/topics/logging for |
| 143 | # more details on how to customize your logging configuration. |
| 144 | LOGGING = { |
| 145 | 'version': 1, |
| 146 | 'disable_existing_loggers': False, |
| 147 | 'filters': { |
| 148 | 'require_debug_false': { |
| 149 | '()': 'django.utils.log.RequireDebugFalse' |
| 150 | } |
| 151 | }, |
| 152 | 'handlers': { |
| 153 | 'mail_admins': { |
| 154 | 'level': 'ERROR', |
| 155 | 'filters': ['require_debug_false'], |
| 156 | 'class': 'django.utils.log.AdminEmailHandler' |
| 157 | } |
| 158 | }, |
| 159 | 'loggers': { |
| 160 | 'django.request': { |
| 161 | 'handlers': ['mail_admins'], |
| 162 | 'level': 'ERROR', |
| 163 | 'propagate': True, |
| 164 | }, |
| 165 | } |
| 166 | } |