Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
converse.js
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
converse.js
Commits
a392a9ef
Commit
a392a9ef
authored
Feb 15, 2016
by
Michal Čihař
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use TEMPLATES settings for configuring templates in Django
Issue #946 Signed-off-by:
Michal Čihař
<
michal@cihar.com
>
parent
15aa5af5
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
34 additions
and
26 deletions
+34
-26
weblate/settings_example.py
weblate/settings_example.py
+26
-26
weblate/trans/admin_views.py
weblate/trans/admin_views.py
+8
-0
No files found.
weblate/settings_example.py
View file @
a392a9ef
...
@@ -173,13 +173,32 @@ STATICFILES_FINDERS = (
...
@@ -173,13 +173,32 @@ STATICFILES_FINDERS = (
# You can generate it using examples/generate-secret-key
# You can generate it using examples/generate-secret-key
SECRET_KEY
=
'jm8fqjlg+5!#xu%e-oh#7!$aa7!6avf7ud*_v=chdrb9qdco6('
SECRET_KEY
=
'jm8fqjlg+5!#xu%e-oh#7!$aa7!6avf7ud*_v=chdrb9qdco6('
# List of callables that know how to import templates from various sources.
TEMPLATES
=
[
TEMPLATE_LOADERS
=
(
{
(
'django.template.loaders.cached.Loader'
,
(
'BACKEND'
:
'django.template.backends.django.DjangoTemplates'
,
'django.template.loaders.filesystem.Loader'
,
'DIRS'
:
[
'django.template.loaders.app_directories.Loader'
,
os
.
path
.
join
(
BASE_DIR
,
'html'
),
)),
],
)
'OPTIONS'
:
{
'context_processors'
:
[
'django.contrib.auth.context_processors.auth'
,
'django.template.context_processors.debug'
,
'django.template.context_processors.i18n'
,
'django.template.context_processors.request'
,
'django.template.context_processors.csrf'
,
'django.contrib.messages.context_processors.messages'
,
'weblate.trans.context_processors.weblate_context'
,
],
'loaders'
:
[
(
'django.template.loaders.cached.Loader'
,
[
'django.template.loaders.filesystem.Loader'
,
'django.template.loaders.app_directories.Loader'
,
]),
],
},
},
]
# GitHub username for sending pull requests.
# GitHub username for sending pull requests.
# Please see the documentation for more details.
# Please see the documentation for more details.
...
@@ -262,14 +281,6 @@ MIDDLEWARE_CLASSES = (
...
@@ -262,14 +281,6 @@ MIDDLEWARE_CLASSES = (
ROOT_URLCONF
=
'weblate.urls'
ROOT_URLCONF
=
'weblate.urls'
TEMPLATE_DIRS
=
(
# Put strings here, like "/home/html/django_templates"
# or "C:/www/django/templates".
# Always use forward slashes, even on Windows.
# Don't forget to use absolute paths, not relative paths.
os
.
path
.
join
(
BASE_DIR
,
'html'
),
)
INSTALLED_APPS
=
(
INSTALLED_APPS
=
(
'django.contrib.auth'
,
'django.contrib.auth'
,
'django.contrib.contenttypes'
,
'django.contrib.contenttypes'
,
...
@@ -293,17 +304,6 @@ INSTALLED_APPS = (
...
@@ -293,17 +304,6 @@ INSTALLED_APPS = (
# Path to locales
# Path to locales
LOCALE_PATHS
=
(
os
.
path
.
join
(
BASE_DIR
,
'locale'
),
)
LOCALE_PATHS
=
(
os
.
path
.
join
(
BASE_DIR
,
'locale'
),
)
# Context processors
TEMPLATE_CONTEXT_PROCESSORS
=
(
'django.contrib.auth.context_processors.auth'
,
'django.template.context_processors.debug'
,
'django.template.context_processors.i18n'
,
'django.template.context_processors.request'
,
'django.template.context_processors.csrf'
,
'django.contrib.messages.context_processors.messages'
,
'weblate.trans.context_processors.weblate_context'
,
)
# Custom exception reporter to include some details
# Custom exception reporter to include some details
DEFAULT_EXCEPTION_REPORTER_FILTER
=
\
DEFAULT_EXCEPTION_REPORTER_FILTER
=
\
'weblate.trans.debug.WeblateExceptionReporterFilter'
'weblate.trans.debug.WeblateExceptionReporterFilter'
...
...
weblate/trans/admin_views.py
View file @
a392a9ef
...
@@ -194,6 +194,14 @@ def performance(request):
...
@@ -194,6 +194,14 @@ def performance(request):
', '
.
join
(
settings
.
ALLOWED_HOSTS
),
', '
.
join
(
settings
.
ALLOWED_HOSTS
),
))
))
if
settings
.
TEMPLATES
:
loader
=
settings
.
TEMPLATES
[
0
].
get
(
'OPTIONS'
,
{}
).
get
(
'loaders'
,
[[
''
]]
)[
0
][
0
]
else
:
loader
=
settings
.
TEMPLATE_LOADERS
[
0
][
0
]
# Cached template loader
# Cached template loader
checks
.
append
((
checks
.
append
((
_
(
'Cached template loader'
),
_
(
'Cached template loader'
),
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment