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 # Django settings for cc1 project.
22 #
23 # Beware that actual configuration is stored in config.py file. This file should
24 # not be modified unless one really knows what he does.
25 #
26 try:
27  from defaults import *
28  from config import *
29 except Exception, ex:
30  print "Error importing CM configuration file: config.py\nReason: %s" % str(ex)
31  exit()
32 
33 import os
34 
35 DEBUG = False
36 TEMPLATE_DEBUG = DEBUG
37 
38 ALLOWED_HOSTS = ['*']
39 
40 PROJECT_DIR = os.path.abspath(os.path.dirname(__file__))
41 
42 # Local time zone for this installation. Choices can be found here:
43 # http://en.wikipedia.org/wiki/List_of_tz_zones_by_name
44 # although not all choices may be available on all operating systems.
45 # In a Windows environment this must be set to your system time zone.
46 TIME_ZONE = 'Europe/Warsaw'
47 
48 # Language code for this installation. All choices can be found here:
49 # http://www.i18nguy.com/unicode/language-identifiers.html
50 LANGUAGE_CODE = 'en-us'
51 
52 SITE_ID = 1
53 
54 # If you set this to False, Django will make some optimizations so as not
55 # to load the internationalization machinery.
56 USE_I18N = True
57 
58 # If you set this to False, Django will not format dates, numbers and
59 # calendars according to the current locale.
60 USE_L10N = True
61 
62 # If you set this to False, Django will not use timezone-aware datetimes.
63 # USE_TZ = True
64 USE_TZ = False
65 
66 # Absolute filesystem path to the directory that will hold user-uploaded files.
67 # Example: "/home/media/media.lawrence.com/media/"
68 MEDIA_ROOT = ''
69 
70 # URL that handles the media served from MEDIA_ROOT. Make sure to use a
71 # trailing slash.
72 # Examples: "http://media.lawrence.com/media/", "http://example.com/media/"
73 MEDIA_URL = ''
74 
75 # Absolute path to the directory static files should be collected to.
76 # Don't put anything in this directory yourself; store your static files
77 # in apps' "static/" subdirectories and in STATICFILES_DIRS.
78 # Example: "/home/media/media.lawrence.com/static/"
79 STATIC_ROOT = ''
80 
81 # URL prefix for static files.
82 # Example: "http://media.lawrence.com/static/"
83 STATIC_URL = '/static/'
84 
85 # Additional locations of static files
86 STATICFILES_DIRS = (
87  # Put strings here, like "/home/html/static" or "C:/www/django/static".
88  # Always use forward slashes, even on Windows.
89  # Don't forget to use absolute paths, not relative paths.
90 )
91 
92 # List of finder classes that know how to find static files in
93 # various locations.
94 STATICFILES_FINDERS = (
95  'django.contrib.staticfiles.finders.FileSystemFinder',
96  'django.contrib.staticfiles.finders.AppDirectoriesFinder',
97 # 'django.contrib.staticfiles.finders.DefaultStorageFinder',
98 )
99 
100 # List of callables that know how to import templates from various sources.
101 TEMPLATE_LOADERS = (
102  'django.template.loaders.filesystem.Loader',
103  'django.template.loaders.app_directories.Loader',
104 # 'django.template.loaders.eggs.Loader',
105 )
106 
107 MIDDLEWARE_CLASSES = (
108  'django.middleware.common.CommonMiddleware',
109  # 'django.contrib.sessions.middleware.SessionMiddleware',
110  # CSRF check set off
111  # 'django.middleware.csrf.CsrfViewMiddleware',
112  # 'django.contrib.auth.middleware.AuthenticationMiddleware',
113  # 'django.contrib.messages.middleware.MessageMiddleware',
114  # Uncomment the next line for simple clickjacking protection:
115  # 'django.middleware.clickjacking.XFrameOptionsMiddleware',
116 )
117 
118 ROOT_URLCONF = 'cm.urls'
119 
120 # Python dotted path to the WSGI application used by Django's runserver.
121 WSGI_APPLICATION = 'cm.wsgi.application'
122 
123 TEMPLATE_DIRS = (
124  # Put strings here, like "/home/html/django_templates" or "C:/www/django/templates".
125  # Always use forward slashes, even on Windows.
126  # Don't forget to use absolute paths, not relative paths.
127  os.path.join(PROJECT_DIR, 'templates'),
128 )
129 
130 INSTALLED_APPS = (
131  # 'django.contrib.auth',
132  # 'django.contrib.contenttypes',
133  # 'django.contrib.sessions',
134  # 'django.contrib.sites',
135  # 'django.contrib.messages',
136  # 'django.contrib.staticfiles',
137  # 'django.contrib.admin',
138  'cm',
139  'south'
140 )
141 
142 # A sample logging configuration. The only tangible logging
143 # performed by this configuration is to send an email to
144 # the site admins on every HTTP 500 error when DEBUG=False.
145 # See http://docs.djangoproject.com/en/dev/topics/logging for
146 # more details on how to customize your logging configuration.
147 LOGGING = {
148  'version': 1,
149  'disable_existing_loggers': False,
150  'formatters': {
151  'verbose': {
152  'format': '%(asctime)s %(levelname)s %(message)s'
153  }
154  },
155  'handlers': {
156  'null': {
157  'level': 'DEBUG',
158  'class': 'django.utils.log.NullHandler',
159  },
160  'console': {
161  'level': 'DEBUG',
162  'class': 'logging.StreamHandler',
163  'formatter': 'verbose'
164  },
165  'request': {
166  'level': 'DEBUG',
167  'class': 'logging.handlers.TimedRotatingFileHandler',
168  'filename': os.path.join(LOG_DIR, 'request.log'),
169  'when': 'D',
170  'interval': 1,
171  'formatter': 'verbose'
172  }
173  },
174  'loggers': {
175  '': {
176  'handlers': ['null'],
177  'propagate': False,
178  'level': 'DEBUG',
179  },
180  'django': {
181  'handlers': ['null'],
182  'propagate': False,
183  'level': 'DEBUG',
184  },
185  'django.db.backends': {
186  'handlers': ['console'],
187  'propagate': False,
188  'level': 'ERROR',
189  },
190  'django.request': {
191  'handlers': ['console'],
192  'level': 'ERROR',
193  'propagate': True,
194  },
195  'request': {
196  'handlers': ['request'],
197  'propagate': False,
198  'level': 'DEBUG',
199  }
200  }
201 }
202