Statistics
| Branch: | Tag: | Revision:

root / pithos / settings.py @ f270dad5

History | View | Annotate | Download (4.2 kB)

1 a7dff008 Antony Chazapis
#coding=utf8
2 a7dff008 Antony Chazapis
# Django settings for pithos project.
3 390c7730 Giorgos Verigakis
4 a7dff008 Antony Chazapis
from os.path import abspath, dirname, exists, join
5 390c7730 Giorgos Verigakis
6 390c7730 Giorgos Verigakis
PROJECT_PATH = dirname(abspath(__file__))
7 390c7730 Giorgos Verigakis
8 a7dff008 Antony Chazapis
DEBUG = True
9 a7dff008 Antony Chazapis
TEMPLATE_DEBUG = DEBUG
10 390c7730 Giorgos Verigakis
11 a7dff008 Antony Chazapis
ADMINS = (
12 a7dff008 Antony Chazapis
    # ('Your Name', 'your_email@domain.com'),
13 a7dff008 Antony Chazapis
)
14 390c7730 Giorgos Verigakis
15 a7dff008 Antony Chazapis
MANAGERS = ADMINS
16 9086b081 Antony Chazapis
17 a7dff008 Antony Chazapis
DATABASES = {
18 a7dff008 Antony Chazapis
    'default': {
19 a7dff008 Antony Chazapis
        'ENGINE': 'django.db.backends.sqlite3',
20 a7dff008 Antony Chazapis
        'NAME': join(PROJECT_PATH, 'pithos.db')
21 a7dff008 Antony Chazapis
    }
22 a7dff008 Antony Chazapis
}
23 a7dff008 Antony Chazapis
24 a7dff008 Antony Chazapis
# Local time zone for this installation. Choices can be found here:
25 a7dff008 Antony Chazapis
# http://en.wikipedia.org/wiki/List_of_tz_zones_by_name
26 a7dff008 Antony Chazapis
# although not all choices may be available on all operating systems.
27 a7dff008 Antony Chazapis
# If running in a Windows environment this must be set to the same as your
28 a7dff008 Antony Chazapis
# system time zone.
29 a7dff008 Antony Chazapis
TIME_ZONE = 'UTC'
30 a7dff008 Antony Chazapis
31 a7dff008 Antony Chazapis
# Language code for this installation. All choices can be found here:
32 a7dff008 Antony Chazapis
# http://www.i18nguy.com/unicode/language-identifiers.html
33 a7dff008 Antony Chazapis
LANGUAGE_CODE = 'en-us'
34 a7dff008 Antony Chazapis
35 a7dff008 Antony Chazapis
SITE_ID = 1
36 a7dff008 Antony Chazapis
37 a7dff008 Antony Chazapis
# If you set this to False, Django will make some optimizations so as not
38 a7dff008 Antony Chazapis
# to load the internationalization machinery.
39 a7dff008 Antony Chazapis
USE_I18N = True
40 a7dff008 Antony Chazapis
41 a7dff008 Antony Chazapis
# If you set this to False, Django will not format dates, numbers and
42 a7dff008 Antony Chazapis
# calendars according to the current locale
43 a7dff008 Antony Chazapis
USE_L10N = True
44 a7dff008 Antony Chazapis
45 a7dff008 Antony Chazapis
# Absolute path to the directory that holds media.
46 a7dff008 Antony Chazapis
# Example: "/home/media/media.lawrence.com/"
47 a7dff008 Antony Chazapis
MEDIA_ROOT = ''
48 a7dff008 Antony Chazapis
49 a7dff008 Antony Chazapis
# URL that handles the media served from MEDIA_ROOT. Make sure to use a
50 a7dff008 Antony Chazapis
# trailing slash if there is a path component (optional in other cases).
51 a7dff008 Antony Chazapis
# Examples: "http://media.lawrence.com", "http://example.com/media/"
52 a7dff008 Antony Chazapis
MEDIA_URL = ''
53 a7dff008 Antony Chazapis
54 a7dff008 Antony Chazapis
# URL prefix for admin media -- CSS, JavaScript and images. Make sure to use a
55 a7dff008 Antony Chazapis
# trailing slash.
56 a7dff008 Antony Chazapis
# Examples: "http://foo.com/media/", "/media/".
57 a7dff008 Antony Chazapis
ADMIN_MEDIA_PREFIX = '/media/'
58 9086b081 Antony Chazapis
59 a7dff008 Antony Chazapis
# Make this unique, and don't share it with anybody.
60 a7dff008 Antony Chazapis
SECRET_KEY = '$j0cdrfm*0sc2j+e@@2f-&3-_@2=^!z#+b-8o4_i10@2%ev7si'
61 a7dff008 Antony Chazapis
62 a7dff008 Antony Chazapis
# List of callables that know how to import templates from various sources.
63 a7dff008 Antony Chazapis
TEMPLATE_LOADERS = (
64 a7dff008 Antony Chazapis
    'django.template.loaders.filesystem.Loader',
65 a7dff008 Antony Chazapis
    'django.template.loaders.app_directories.Loader',
66 a7dff008 Antony Chazapis
)
67 a7dff008 Antony Chazapis
68 a7dff008 Antony Chazapis
MIDDLEWARE_CLASSES = (
69 a7dff008 Antony Chazapis
    'django.middleware.common.CommonMiddleware',
70 a7dff008 Antony Chazapis
    #'django.middleware.csrf.CsrfViewMiddleware',
71 a7dff008 Antony Chazapis
    #'django.contrib.sessions.middleware.SessionMiddleware',
72 a7dff008 Antony Chazapis
    #'django.contrib.auth.middleware.AuthenticationMiddleware',
73 a7dff008 Antony Chazapis
    #'django.contrib.messages.middleware.MessageMiddleware',
74 a7dff008 Antony Chazapis
    'pithos.middleware.LoggingConfigMiddleware',
75 a7dff008 Antony Chazapis
    'pithos.middleware.SecureMiddleware',
76 a7dff008 Antony Chazapis
    'pithos.middleware.UserMiddleware'
77 a7dff008 Antony Chazapis
)
78 a7dff008 Antony Chazapis
79 a7dff008 Antony Chazapis
ROOT_URLCONF = 'pithos.urls'
80 a7dff008 Antony Chazapis
81 a7dff008 Antony Chazapis
TEMPLATE_DIRS = (
82 a7dff008 Antony Chazapis
    # Put strings here, like "/home/html/django_templates" or "C:/www/django/templates".
83 a7dff008 Antony Chazapis
    # Always use forward slashes, even on Windows.
84 a7dff008 Antony Chazapis
    # Don't forget to use absolute paths, not relative paths.
85 a7dff008 Antony Chazapis
)
86 a7dff008 Antony Chazapis
87 18d8fb23 Antony Chazapis
# Setup logging (use this name for the setting to avoid conflicts with django > 1.2.x).
88 18d8fb23 Antony Chazapis
LOGGING_SETUP = {
89 18d8fb23 Antony Chazapis
    'version': 1,
90 18d8fb23 Antony Chazapis
    'disable_existing_loggers': True,
91 18d8fb23 Antony Chazapis
    'formatters': {
92 18d8fb23 Antony Chazapis
        'simple': {
93 18d8fb23 Antony Chazapis
            'format': '%(message)s'
94 18d8fb23 Antony Chazapis
        },
95 18d8fb23 Antony Chazapis
        'verbose': {
96 18d8fb23 Antony Chazapis
            'format': '%(asctime)s [%(levelname)s] %(name)s %(message)s'
97 18d8fb23 Antony Chazapis
        },
98 18d8fb23 Antony Chazapis
    },
99 18d8fb23 Antony Chazapis
    'handlers': {
100 18d8fb23 Antony Chazapis
        'null': {
101 18d8fb23 Antony Chazapis
            'class': 'logging.NullHandler',
102 18d8fb23 Antony Chazapis
        },
103 18d8fb23 Antony Chazapis
        'console': {
104 18d8fb23 Antony Chazapis
            'class': 'logging.StreamHandler',
105 18d8fb23 Antony Chazapis
            'formatter': 'verbose'
106 18d8fb23 Antony Chazapis
        },
107 f270dad5 root
        'file': {
108 f270dad5 root
            'class': 'logging.FileHandler',
109 f270dad5 root
            'formatter': 'verbose'
110 f270dad5 root
        },
111 18d8fb23 Antony Chazapis
    },
112 18d8fb23 Antony Chazapis
    'loggers': {
113 18d8fb23 Antony Chazapis
        'pithos': {
114 18d8fb23 Antony Chazapis
            'handlers': ['console'],
115 18d8fb23 Antony Chazapis
            'level': 'DEBUG' if DEBUG else 'INFO'
116 18d8fb23 Antony Chazapis
        },
117 18d8fb23 Antony Chazapis
    }
118 18d8fb23 Antony Chazapis
}
119 a7dff008 Antony Chazapis
120 a7dff008 Antony Chazapis
# The server is behind a proxy (apache and gunicorn setup).
121 a7dff008 Antony Chazapis
USE_X_FORWARDED_HOST = False
122 a7dff008 Antony Chazapis
123 a7dff008 Antony Chazapis
# Set umask (needed for gunicorn setup).
124 a7dff008 Antony Chazapis
#umask(0077)
125 a7dff008 Antony Chazapis
126 a7dff008 Antony Chazapis
# Either set local users here, or a remote host.
127 a7dff008 Antony Chazapis
# To disable local users set to None.
128 a7dff008 Antony Chazapis
AUTHENTICATION_USERS = {
129 a7dff008 Antony Chazapis
    '0000': 'test',
130 a7dff008 Antony Chazapis
    '0001': 'verigak',
131 a7dff008 Antony Chazapis
    '0002': 'chazapis',
132 a7dff008 Antony Chazapis
    '0003': 'gtsouk',
133 a7dff008 Antony Chazapis
    '0004': 'papagian',
134 a7dff008 Antony Chazapis
    '0005': 'louridas',
135 a7dff008 Antony Chazapis
    '0006': 'chstath',
136 a7dff008 Antony Chazapis
    '0007': 'pkanavos',
137 a7dff008 Antony Chazapis
    '0008': 'mvasilak',
138 a7dff008 Antony Chazapis
    '0009': 'διογένης'
139 a7dff008 Antony Chazapis
}
140 a7dff008 Antony Chazapis
141 a7dff008 Antony Chazapis
# Where astakos is hosted.
142 a7dff008 Antony Chazapis
AUTHENTICATION_HOST = '127.0.0.1:10000'
143 a7dff008 Antony Chazapis
144 a7dff008 Antony Chazapis
conf = join(PROJECT_PATH, 'settings.local')
145 9086b081 Antony Chazapis
if exists(conf):
146 9086b081 Antony Chazapis
    execfile(conf)
147 5a96180b Antony Chazapis
elif exists('/etc/pithos/settings.local'):
148 5a96180b Antony Chazapis
    execfile('/etc/pithos/settings.local')
149 a7dff008 Antony Chazapis
150 a7dff008 Antony Chazapis
INSTALLED_APPS = (
151 a7dff008 Antony Chazapis
    'pithos.api',
152 a7dff008 Antony Chazapis
)