cc1  v2.1
CC1 source code docs
 All Classes Namespaces Files Functions Variables Pages
settings.py
Go to the documentation of this file.
1 # -*- coding: utf-8 -*-
2 # @COPYRIGHT_begin
3 #
4 # Copyright [2010-2014] Institute of Nuclear Physics PAN, Krakow, Poland
5 #
6 # Licensed under the Apache License, Version 2.0 (the "License");
7 # you may not use this file except in compliance with the License.
8 # You may obtain a copy of the License at
9 #
10 # http://www.apache.org/licenses/LICENSE-2.0
11 #
12 # Unless required by applicable law or agreed to in writing, software
13 # distributed under the License is distributed on an "AS IS" BASIS,
14 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 # See the License for the specific language governing permissions and
16 # limitations under the License.
17 #
18 # @COPYRIGHT_end
19 
20 ##
21 # @package src.clm.settings
22 # Django settings for cc1 project.
23 #
24 # Beware that actual configuration is stored in config.py file. This file should
25 # not be modified unless one really knows what he does.
26 #
27 import os
28 try:
29  from defaults import *
30  from config import *
31 except Exception, ex:
32  print "Error importing CLM configuration file: config.py\nReason: %s" % str(ex)
33  exit()
34 
35 DEBUG = False
36 TEMPLATE_DEBUG = DEBUG
37 PROJECT_DIR = os.path.abspath(os.path.dirname(__file__))
38 
39 ALLOWED_HOSTS = ['*']
40 
41 # Local time zone for this installation. Choices can be found here:
42 # http://en.wikipedia.org/wiki/List_of_tz_zones_by_name
43 # although not all choices may be available on all operating systems.
44 # In a Windows environment this must be set to your system time zone.
45 TIME_ZONE = 'Europe/Warsaw'
46 
47 # Language code for this installation. All choices can be found here:
48 # http://www.i18nguy.com/unicode/language-identifiers.html
49 LANGUAGE_CODE = 'en-us'
50 
51 SITE_ID = 1
52 
53 # If you set this to False, Django will make some optimizations so as not
54 # to load the internationalization machinery.
55 USE_I18N = True
56 
57 # If you set this to False, Django will not format dates, numbers and
58 # calendars according to the current locale.
59 USE_L10N = True
60 
61 # If you set this to False, Django will not use timezone-aware datetimes.
62 # USE_TZ = True
63 USE_TZ = False
64 
65 # Absolute filesystem path to the directory that will hold user-uploaded files.
66 # Example: "/home/media/media.lawrence.com/media/"
67 MEDIA_ROOT = ''
68 
69 # URL that handles the media served from MEDIA_ROOT. Make sure to use a
70 # trailing slash.
71 # Examples: "http://media.lawrence.com/media/", "http://example.com/media/"
72 MEDIA_URL = ''
73 
74 # Absolute path to the directory static files should be collected to.
75 # Don't put anything in this directory yourself; store your static files
76 # in apps' "static/" subdirectories and in STATICFILES_DIRS.
77 # Example: "/home/media/media.lawrence.com/static/"
78 STATIC_ROOT = ''
79 
80 # URL prefix for static files.
81 # Example: "http://media.lawrence.com/static/"
82 STATIC_URL = '/static/'
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 # 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 MIDDLEWARE_CLASSES = (
107  'django.middleware.common.CommonMiddleware',
108  # 'django.contrib.sessions.middleware.SessionMiddleware',
109  # CSRF check set off
110  # 'django.middleware.csrf.CsrfViewMiddleware',
111  # 'django.contrib.auth.middleware.AuthenticationMiddleware',
112  # 'django.contrib.messages.middleware.MessageMiddleware',
113  # Uncomment the next line for simple clickjacking protection:
114  # 'django.middleware.clickjacking.XFrameOptionsMiddleware',
115 )
116 
117 ROOT_URLCONF = 'clm.urls'
118 
119 # Python dotted path to the WSGI application used by Django's runserver.
120 WSGI_APPLICATION = 'clm.wsgi.application'
121 
122 TEMPLATE_DIRS = (
123  # Put strings here, like "/home/html/django_templates" or "C:/www/django/templates".
124  # Always use forward slashes, even on Windows.
125  # Don't forget to use absolute paths, not relative paths.
126  '/etc/cc1/clm/templates/',
127  os.path.join(PROJECT_DIR, 'templates')
128 )
129 
130 INSTALLED_APPS = (
131  'clm',
132  'south'
133 )
134 
135 # A sample logging configuration. The only tangible logging
136 # performed by this configuration is to send an email to
137 # the site admins on every HTTP 500 error when DEBUG=False.
138 # See http://docs.djangoproject.com/en/dev/topics/logging for
139 # more details on how to customize your logging configuration.
140 
141 LOGGING = {
142  'version': 1,
143  'disable_existing_loggers': False,
144  'formatters': {
145  'verbose': {
146  'format': '%(asctime)s %(levelname)s %(message)s'
147  }
148  },
149  'handlers': {
150  'null': {
151  'level': 'DEBUG',
152  'class': 'django.utils.log.NullHandler',
153  },
154  'console': {
155  'level': 'DEBUG',
156  'class': 'logging.StreamHandler',
157  'formatter': 'verbose'
158  },
159  'request': {
160  'level': 'DEBUG',
161  'class': 'logging.handlers.TimedRotatingFileHandler',
162  'filename': os.path.join(LOG_DIR, 'request.log'),
163  'when': 'D',
164  'interval': 1,
165  'formatter': 'verbose'
166  }
167  },
168  'loggers': {
169  '': {
170  'handlers': ['null'],
171  'propagate': False,
172  'level': 'DEBUG',
173  },
174  'django': {
175  'handlers': ['null'],
176  'propagate': False,
177  'level': 'DEBUG',
178  },
179  'django.db.backends': {
180  'handlers': ['console'],
181  'propagate': False,
182  'level': 'ERROR',
183  },
184  'django.request': {
185  'handlers': ['console'],
186  'level': 'ERROR',
187  'propagate': True,
188  },
189  'request': {
190  'handlers': ['request'],
191  'propagate': False,
192  'level': 'DEBUG',
193  }
194  }
195 }
196