1 # Django settings for astakos project.
3 from os.path import abspath, dirname, exists, join
5 PROJECT_PATH = dirname(abspath(__file__))
11 # ('Your Name', 'your_email@domain.com'),
18 'ENGINE': 'django.db.backends.sqlite3',
19 'NAME': join(PROJECT_PATH, 'astakos.db')
23 # Local time zone for this installation. Choices can be found here:
24 # http://en.wikipedia.org/wiki/List_of_tz_zones_by_name
25 # although not all choices may be available on all operating systems.
26 # If running in a Windows environment this must be set to the same as your
30 # Language code for this installation. All choices can be found here:
31 # http://www.i18nguy.com/unicode/language-identifiers.html
32 LANGUAGE_CODE = 'en-us'
36 # If you set this to False, Django will make some optimizations so as not
37 # to load the internationalization machinery.
40 # If you set this to False, Django will not format dates, numbers and
41 # calendars according to the current locale
44 # Absolute path to the directory that holds media.
45 # Example: "/home/media/media.lawrence.com/"
48 # URL that handles the media served from MEDIA_ROOT. Make sure to use a
49 # trailing slash if there is a path component (optional in other cases).
50 # Examples: "http://media.lawrence.com", "http://example.com/media/"
53 # URL prefix for admin media -- CSS, JavaScript and images. Make sure to use a
55 # Examples: "http://foo.com/media/", "/media/".
56 ADMIN_MEDIA_PREFIX = '/media/'
58 # Make this unique, and don't share it with anybody.
59 SECRET_KEY = '$j0cdrfm*0sc2j+e@@2f-&3-_@2=^!z#+b-8o4_i10@2%ev7si'
61 # List of callables that know how to import templates from various sources.
63 'django.template.loaders.filesystem.Loader',
64 'django.template.loaders.app_directories.Loader',
67 MIDDLEWARE_CLASSES = (
68 'django.middleware.common.CommonMiddleware',
69 'django.middleware.csrf.CsrfViewMiddleware',
70 'django.contrib.sessions.middleware.SessionMiddleware',
71 'django.contrib.auth.middleware.AuthenticationMiddleware',
72 'django.contrib.messages.middleware.MessageMiddleware',
73 'astakos.middleware.LoggingConfigMiddleware',
74 'astakos.middleware.SecureMiddleware'
77 ROOT_URLCONF = 'astakos.urls'
80 # Put strings here, like "/home/html/django_templates" or "C:/www/django/templates".
81 # Always use forward slashes, even on Windows.
82 # Don't forget to use absolute paths, not relative paths.
83 join(PROJECT_PATH, 'im/admin/templates/')
86 TEMPLATE_CONTEXT_PROCESSORS = (
87 'django.contrib.messages.context_processors.messages',
88 'django.contrib.auth.context_processors.auth',
89 'django.core.context_processors.i18n',
90 'django.core.context_processors.media',
91 'django.core.context_processors.request',
92 'astakos.im.context_processors.media',
93 'astakos.im.context_processors.im_modules',
94 'astakos.im.context_processors.next',
95 'astakos.im.context_processors.code',
96 'astakos.im.context_processors.invitations')
98 AUTHENTICATION_BACKENDS = ('astakos.im.auth_backends.EmailBackend',
99 'astakos.im.auth_backends.TokenBackend')
101 CUSTOM_USER_MODEL = 'astakos.im.AstakosUser'
103 # Setup logging (use this name for the setting to avoid conflicts with django > 1.2.x).
106 'disable_existing_loggers': True,
109 'format': '%(message)s'
112 'format': '%(asctime)s [%(levelname)s] %(name)s %(message)s'
117 'class': 'logging.NullHandler',
120 'class': 'logging.StreamHandler',
121 'formatter': 'verbose'
126 'handlers': ['console'],
127 'level': 'DEBUG' if DEBUG else 'INFO'
132 # The server is behind a proxy (apache and gunicorn setup).
133 USE_X_FORWARDED_HOST = False
135 # Set umask (needed for gunicorn setup).
138 # The URL where requests are redirected for login, especially when using the login_required() decorator.
141 conf = join(PROJECT_PATH, 'settings.local')
144 elif exists('/etc/astakos/settings.local'):
145 execfile('/etc/astakos/settings.local')
150 'django.contrib.auth',
151 'django.contrib.contenttypes',
152 'django.contrib.messages',
153 'django.contrib.sites',
154 'django.contrib.sessions'