2 # Django settings for pithos project.
4 from os.path import abspath, dirname, exists, join
6 PROJECT_PATH = dirname(abspath(__file__))
12 # ('Your Name', 'your_email@domain.com'),
19 'ENGINE': 'django.db.backends.sqlite3',
20 'NAME': join(PROJECT_PATH, 'pithos.db')
24 # Local time zone for this installation. Choices can be found here:
25 # http://en.wikipedia.org/wiki/List_of_tz_zones_by_name
26 # although not all choices may be available on all operating systems.
27 # If running in a Windows environment this must be set to the same as your
31 # Language code for this installation. All choices can be found here:
32 # http://www.i18nguy.com/unicode/language-identifiers.html
33 LANGUAGE_CODE = 'en-us'
37 # If you set this to False, Django will make some optimizations so as not
38 # to load the internationalization machinery.
41 # If you set this to False, Django will not format dates, numbers and
42 # calendars according to the current locale
45 # Absolute path to the directory that holds media.
46 # Example: "/home/media/media.lawrence.com/"
49 # URL that handles the media served from MEDIA_ROOT. Make sure to use a
50 # trailing slash if there is a path component (optional in other cases).
51 # Examples: "http://media.lawrence.com", "http://example.com/media/"
54 # URL prefix for admin media -- CSS, JavaScript and images. Make sure to use a
56 # Examples: "http://foo.com/media/", "/media/".
57 ADMIN_MEDIA_PREFIX = '/media/'
59 # Make this unique, and don't share it with anybody.
60 SECRET_KEY = '$j0cdrfm*0sc2j+e@@2f-&3-_@2=^!z#+b-8o4_i10@2%ev7si'
62 # List of callables that know how to import templates from various sources.
64 'django.template.loaders.filesystem.Loader',
65 'django.template.loaders.app_directories.Loader',
68 MIDDLEWARE_CLASSES = (
69 'django.middleware.common.CommonMiddleware',
70 #'django.middleware.csrf.CsrfViewMiddleware',
71 #'django.contrib.sessions.middleware.SessionMiddleware',
72 #'django.contrib.auth.middleware.AuthenticationMiddleware',
73 #'django.contrib.messages.middleware.MessageMiddleware',
74 'pithos.middleware.LoggingConfigMiddleware',
75 'pithos.middleware.SecureMiddleware',
76 'pithos.middleware.UserMiddleware'
79 ROOT_URLCONF = 'pithos.urls'
82 # Put strings here, like "/home/html/django_templates" or "C:/www/django/templates".
83 # Always use forward slashes, even on Windows.
84 # Don't forget to use absolute paths, not relative paths.
87 # Setup logging (use this name for the setting to avoid conflicts with django > 1.2.x).
90 'disable_existing_loggers': True,
93 'format': '%(message)s'
96 'format': '%(asctime)s [%(levelname)s] %(name)s %(message)s'
101 'class': 'logging.NullHandler',
104 'class': 'logging.StreamHandler',
105 'formatter': 'verbose'
108 'class': 'logging.FileHandler',
109 'formatter': 'verbose'
114 'handlers': ['console'],
115 'level': 'DEBUG' if DEBUG else 'INFO'
120 # The server is behind a proxy (apache and gunicorn setup).
121 USE_X_FORWARDED_HOST = False
123 # Set umask (needed for gunicorn setup).
126 # Either set local users here, or a remote host.
127 # To disable local users set to None.
128 AUTHENTICATION_USERS = {
141 # Where astakos is hosted.
142 AUTHENTICATION_HOST = '127.0.0.1:10000'
144 conf = join(PROJECT_PATH, 'settings.local')
147 elif exists('/etc/pithos/settings.local'):
148 execfile('/etc/pithos/settings.local')