Commit | Line | Data |
---|---|---|
4be9d9da OL |
1 | # -*- encoding: utf-8 -*- |
2 | ||
3 | ################################################################################ | |
4 | # SETTINGS | |
5 | ################################################################################ | |
6 | ||
7 | conf_file = '''# -*- encoding: utf-8 -* | |
8 | ||
9 | DATABASE_ENGINE = 'mysql' # 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'. | |
10 | DATABASE_NAME = '' | |
11 | DATABASE_USER = '' # Not used with sqlite3. | |
12 | DATABASE_PASSWORD = '' # Not used with sqlite3. | |
13 | DATABASE_HOST = '' # Set to empty string for localhost. Not used with sqlite3. | |
14 | DATABASE_PORT = '' # Set to empty string for default. Not used with sqlite3. | |
15 | ''' | |
16 | ||
17 | dashboard_file ='''# -*- encoding: utf-8 -* | |
18 | ||
19 | """ | |
20 | This file was generated with the customdashboard management command, it | |
21 | contains the two classes for the main dashboard and app index dashboard. | |
22 | You can customize these classes as you want. | |
23 | ||
24 | To activate your index dashboard add the following to your settings.py:: | |
25 | ADMIN_TOOLS_INDEX_DASHBOARD = 'SIGMA.dashboard.CustomIndexDashboard' | |
26 | ||
27 | And to activate the app index dashboard:: | |
28 | ADMIN_TOOLS_APP_INDEX_DASHBOARD = 'SIGMA.dashboard.CustomAppIndexDashboard' | |
29 | """ | |
30 | ||
31 | from django.utils.translation import ugettext_lazy as _ | |
32 | from django.core.urlresolvers import reverse | |
33 | ||
34 | from admin_tools.dashboard import modules, Dashboard, AppIndexDashboard | |
35 | from admin_tools.utils import get_admin_site_name | |
36 | ||
37 | ||
38 | class CustomIndexDashboard(Dashboard): | |
39 | """ | |
40 | Custom index dashboard for SIGMA. | |
41 | """ | |
42 | def init_with_context(self, context): | |
43 | site_name = get_admin_site_name(context) | |
44 | ||
45 | # append an app list module for "Applications" | |
46 | self.children.append(modules.AppList( | |
47 | _('Applications'), | |
48 | exclude=('django.contrib.*',), | |
49 | )) | |
50 | ||
51 | # append an app list module for "Administration" | |
52 | self.children.append(modules.AppList( | |
53 | _('Administration'), | |
54 | models=('django.contrib.*',), | |
55 | )) | |
56 | ||
57 | # append a recent actions module | |
58 | self.children.append(modules.RecentActions(_('Recent Actions'), 5)) | |
59 | ''' | |
60 | ||
61 | ||
62 | auf_urls_template = '''# -*- encoding: utf-8 -* | |
63 | from django.conf.urls.defaults import patterns, include, handler500, handler404, url | |
64 | from django.conf import settings | |
65 | from django.contrib import admin | |
66 | ||
67 | admin.autodiscover() | |
68 | ||
69 | handler404 | |
70 | handler500 # Pyflakes | |
71 | ||
72 | urlpatterns = patterns( | |
73 | '', | |
74 | ######## page d'accueil de demo ###### | |
75 | (r'^$', 'auf.django.skin.views.demo'), | |
76 | ###################################### | |
77 | url(r'^admin_tools/', include('admin_tools.urls')), | |
78 | (r'^admin/', include(admin.site.urls)), | |
79 | (r'^connexion/$', 'django.contrib.auth.views.login'), | |
80 | (r'^deconnexion/$', 'django.contrib.auth.views.logout'), | |
81 | ||
82 | ) | |
83 | ||
84 | if settings.DEBUG: | |
85 | urlpatterns += patterns('', | |
86 | (r'^media/(?P<path>.*)$', 'django.views.static.serve', | |
87 | {'document_root': settings.MEDIA_ROOT}), | |
88 | ) | |
89 | ''' | |
90 | ||
91 | auf_settings_template = '''# -*- encoding: utf-8 -*- | |
92 | ||
93 | import os | |
94 | import socket | |
95 | from conf import * | |
96 | ||
97 | # Rapports d'erreurs | |
98 | EMAIL_SUBJECT_PREFIX = '[%(project_name)s - %%s] ' %% socket.gethostname() | |
99 | ADMINS = ( | |
100 | ('Équipe ARI-SI', 'developpeurs@ca.auf.org'), | |
101 | ) | |
102 | ||
103 | MANAGERS = ADMINS | |
104 | ||
105 | TIME_ZONE = 'Canada/Montreal' | |
106 | ||
107 | LANGUAGE_CODE = 'fr-ca' | |
108 | ||
109 | # Absolute path to the directory that holds media. | |
110 | # Example: "/home/media/media.lawrence.com/" | |
111 | MEDIA_ROOT = %(media_root)s | |
112 | ||
113 | # URL that handles the media served from MEDIA_ROOT. Make sure to use a | |
114 | # trailing slash if there is a path component (optional in other cases). | |
115 | # Examples: "http://media.lawrence.com", "http://example.com/media/" | |
116 | MEDIA_URL = '/media/' | |
117 | ||
118 | # URL prefix for admin media -- CSS, JavaScript and images. Make sure to use a | |
119 | # trailing slash. | |
120 | # Examples: "http://foo.com/media/", "/media/". | |
121 | ADMIN_MEDIA_PREFIX = '/media/django/' | |
122 | ||
123 | # Don't share this with anybody. | |
124 | SECRET_KEY = '%(secret)s' | |
125 | ||
126 | MIDDLEWARE_CLASSES = ( | |
127 | 'django.middleware.common.CommonMiddleware', | |
128 | 'django.contrib.sessions.middleware.SessionMiddleware', | |
129 | 'django.contrib.auth.middleware.AuthenticationMiddleware', | |
130 | 'django.middleware.doc.XViewMiddleware', | |
131 | ) | |
132 | ||
133 | ROOT_URLCONF = '%(urlconf)s' | |
134 | ||
135 | ||
136 | INSTALLED_APPS = ( | |
137 | 'auf.django.skin', | |
138 | 'admin_tools', | |
139 | 'admin_tools.theming', | |
140 | 'admin_tools.menu', | |
141 | 'admin_tools.dashboard', | |
142 | 'django.contrib.auth', | |
143 | 'django.contrib.contenttypes', | |
144 | 'django.contrib.sessions', | |
145 | 'django.contrib.admin', | |
146 | 'south', | |
147 | ) | |
148 | ||
149 | TEMPLATE_CONTEXT_PROCESSORS = ( | |
150 | 'django.core.context_processors.auth', | |
151 | 'django.core.context_processors.debug', | |
152 | 'django.core.context_processors.i18n', | |
153 | 'django.core.context_processors.media', | |
154 | 'django.contrib.messages.context_processors.messages', | |
155 | 'django.core.context_processors.request', | |
156 | 'auf.django.skin.context_processors.auf', | |
157 | ) | |
158 | ||
159 | ||
160 | TEMPLATE_LOADERS = ( | |
161 | 'django.template.loaders.filesystem.load_template_source', | |
162 | 'django.template.loaders.app_directories.load_template_source', | |
163 | ) | |
164 | ||
165 | TEMPLATE_DIRS = ( | |
166 | os.path.join(os.path.dirname(__file__), "templates"), | |
167 | ) | |
168 | ||
169 | SOUTH_TESTS_MIGRATE = False | |
170 | ||
171 | ADMIN_TOOLS_INDEX_DASHBOARD = 'project.dashboard.CustomIndexDashboard' | |
172 | ||
173 | ''' | |
174 | ||
175 | ################################################################################ | |
176 | # DEVELOPPEMENT | |
177 | ################################################################################ | |
178 | auf_development_settings = '''# -*- encoding: utf-8 -*- | |
179 | ||
180 | from %(project)s.settings import * | |
181 | DEBUG=True | |
182 | TEMPLATE_DEBUG=DEBUG | |
183 | ||
184 | # Décommentez ces lignes pour activer la debugtoolbar | |
185 | #INTERNAL_IPS = ('127.0.0.1',) | |
186 | #INSTALLED_APPS += ('debug_toolbar',) | |
187 | #MIDDLEWARE_CLASSES += ('debug_toolbar.middleware.DebugToolbarMiddleware',) | |
188 | ||
189 | AUTH_PASSWORD_REQUIRED = False | |
190 | ''' | |
191 | ||
192 | ################################################################################ | |
193 | # PRODUCTION | |
194 | ################################################################################ | |
195 | auf_production_settings = ''' # -*- encoding: utf-8 -*- | |
196 | ||
197 | # En production, rediriger la sortie terminal on disponible en WSGI | |
198 | # vers la sortie fichier errorlog. | |
199 | import sys | |
200 | sys.stdout = sys.stderr | |
201 | ||
202 | from %(project)s.settings import * | |
203 | ''' |