source: main/trunk/openPLM/settings.py @ 471

Revision 471, 5.2 KB checked in by pcosquer, 9 years ago (diff)

csv: work on #46
this commit enables mails sending/index updating after the database commit
a new task (update_indexes) is available to update several indexes at once

Line 
1#-!- coding:utf-8 -!-
2# Django settings for openPLM project.
3# sqlite version
4
5import os.path
6
7DEBUG = True
8TEMPLATE_DEBUG = DEBUG
9
10ADMINS = (
11    ('Your Name', 'your_email@domain.com'),
12)
13
14MANAGERS = ADMINS
15
16DATABASE_ENGINE = 'postgresql_psycopg2'           # 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'.
17DATABASE_NAME = 'openplm'             # Or path to database file if using sqlite3.
18DATABASE_USER = 'django'             # Not used with sqlite3.
19DATABASE_PASSWORD = 'django#6'         # Not used with sqlite3.
20DATABASE_HOST = 'localhost'             # Set to empty string for localhost. Not used with sqlite3.
21DATABASE_PORT = ''             # Set to empty string for default. Not used with sqlite3.
22
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
27# system time zone.
28TIME_ZONE = 'Europe/Paris'
29
30# Language code for this installation. All choices can be found here:
31# http://www.i18nguy.com/unicode/language-identifiers.html
32LANGUAGE_CODE = 'en-en'
33
34SITE_ID = 1
35
36# If you set this to False, Django will make some optimizations so as not
37# to load the internationalization machinery.
38USE_I18N = True
39
40# Absolute path to the directory that holds media.
41# Example: "/home/media/media.lawrence.com/"
42MEDIA_ROOT = '/var/django/openPLM/trunk/openPLM/media/'
43
44# URL that handles the media served from MEDIA_ROOT. Make sure to use a
45# trailing slash if there is a path component (optional in other cases).
46# Examples: "http://media.lawrence.com", "http://example.com/media/"
47MEDIA_URL = '/media/'
48
49# URL prefix for admin media -- CSS, JavaScript and images. Make sure to use a
50# trailing slash.
51# Examples: "http://foo.com/media/", "/media/".
52ADMIN_MEDIA_PREFIX = '/media/admin/'
53
54# Make this unique, and don't share it with anybody.
55SECRET_KEY = '0ham7d#fh669-xi@wxf1wcpbhn6tbbegtv_cml()_wcboyw&u&'
56
57# List of callables that know how to import templates from various sources.
58TEMPLATE_LOADERS = (
59    'django.template.loaders.filesystem.load_template_source',
60    'django.template.loaders.app_directories.load_template_source',
61#     'django.template.loaders.eggs.load_template_source',
62)
63
64MIDDLEWARE_CLASSES = (
65    'django.middleware.common.CommonMiddleware',
66    'django.contrib.csrf.middleware.CsrfMiddleware',
67    'django.contrib.sessions.middleware.SessionMiddleware',
68    'django.middleware.locale.LocaleMiddleware',
69    'django.contrib.auth.middleware.AuthenticationMiddleware',
70)
71
72ugettext = lambda s: s
73LANGUAGES = (
74      ('fr', u'Français'),
75      ('en', 'English'),
76)
77
78ROOT_URLCONF = 'openPLM.urls'
79
80TEMPLATE_DIRS = (
81    # Put strings here, like "/home/html/django_templates" or "C:/www/django/templates".
82    # Always use forward slashes, even on Windows.
83    # Don't forget to use absolute paths, not relative paths.
84    "/var/django/openPLM/trunk/openPLM/templates",
85)
86
87INSTALLED_APPS = (
88    'django.contrib.auth',
89    'django.contrib.contenttypes',
90    'django.contrib.sessions',
91    'django.contrib.sites',
92    'django.contrib.admin',
93    'django.contrib.comments',
94    'django.contrib.humanize',
95    'djcelery',
96    'haystack',
97    'south',
98    'openPLM.plmapp',
99    # you can add your application after this line
100    'openPLM.cad',
101    'openPLM.computer',
102    'openPLM.cae',
103    'openPLM.office',
104)
105
106AUTH_PROFILE_MODULE = 'plmapp.UserProfile'
107
108CELERY_CREATE_MISSING_QUEUES = True
109CELERY_ROUTES = {
110    "openPLM.plmapp.tasks.update_index": {"queue": "index"},
111    "openPLM.plmapp.tasks.update_indexes": {"queue": "index"},
112    "openPLM.plmapp.mail.do_send_histories_mail" : {"queue" : "mails"},
113    "openPLM.plmapp.mail.do_send_mail" : {"queue" : "mails"},
114}
115
116EMAIL_HOST = 'localhost'
117EMAIL_PORT = 1025
118
119######################
120# openPLM's settings #
121######################
122
123#: directory that stores documents. Make sure to use a trailing slash.
124DOCUMENTS_DIR = "/var/openPLM/docs/"
125THUMBNAILS_DIR = os.path.join(MEDIA_ROOT, "thumbnails/")
126#: directory that stores thumbnails. Make sure to use a trailing slash.
127THUMBNAILS_URL = MEDIA_URL + "thumbnails/"
128
129# Cookie used for session is temporary and is deleted when browser is closed
130SESSION_EXPIRE_AT_BROWSER_CLOSE = True
131
132# Add user, messages and perms variables in RequestContext
133TEMPLATE_CONTEXT_PROCESSORS = (
134        "django.contrib.auth.context_processors.auth",
135        "django.core.context_processors.debug",
136        "django.core.context_processors.i18n",
137        "django.core.context_processors.media",
138        "django.core.context_processors.request",
139        )
140
141
142
143#: expeditor's mail used when sending notification emails
144EMAIL_OPENPLM = "no-reply@openplm.example.com"
145
146#: Max file size for documents in bytes, -1 means illimited
147MAX_FILE_SIZE = -1
148
149# search stuff
150HAYSTACK_SITECONF = 'openPLM.plmapp.search_sites'
151HAYSTACK_SEARCH_ENGINE = 'xapian'
152HAYSTACK_XAPIAN_PATH = "/var/openPLM/xapian_index/"
153HAYSTACK_INCLUDE_SPELLING = True
154EXTRACTOR = os.path.abspath(os.path.join(os.path.dirname(__file__), "bin", "extractor.sh"))
155
156# celery stuff
157import djcelery
158djcelery.setup_loader()
159
160BROKER_HOST = "localhost"
161BROKER_PORT = 5672
162BROKER_USER = "openplm"
163BROKER_PASSWORD = "secret"
164BROKER_VHOST = "openplm"
165
166COMPANY = "company"
167
Note: See TracBrowser for help on using the repository browser.