Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
D
django-wiki
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
edx
django-wiki
Commits
77caec3d
Commit
77caec3d
authored
Mar 07, 2016
by
Saleem Latif
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
set WIKI_REQUEST_CACHE_MIDDLEWARE_CLASS to None if settings is not configured
parent
614c5686
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
3 deletions
+10
-3
wiki/middleware.py
+10
-3
No files found.
wiki/middleware.py
View file @
77caec3d
...
@@ -3,9 +3,16 @@ import importlib
...
@@ -3,9 +3,16 @@ import importlib
from
django.conf
import
settings
from
django.conf
import
settings
if
getattr
(
settings
,
"WIKI_REQUEST_CACHE_MIDDLEWARE_CLASS"
,
None
):
# Take WIKI_REQUEST_CACHE_MIDDLEWARE_CLASS from django settings, if settings is not configured or of
class_name
=
settings
.
WIKI_REQUEST_CACHE_MIDDLEWARE_CLASS
.
split
(
"."
)[
-
1
]
# WIKI_REQUEST_CACHE_MIDDLEWARE_CLASS setting is not defined then use custom middleware from django-wiki
module
=
"."
.
join
(
settings
.
WIKI_REQUEST_CACHE_MIDDLEWARE_CLASS
.
split
(
'.'
)[:
-
1
])
if
hasattr
(
settings
,
"WIKI_REQUEST_CACHE_MIDDLEWARE_CLASS"
):
WIKI_REQUEST_CACHE_MIDDLEWARE_CLASS
=
settings
.
WIKI_REQUEST_CACHE_MIDDLEWARE_CLASS
else
:
WIKI_REQUEST_CACHE_MIDDLEWARE_CLASS
=
None
if
WIKI_REQUEST_CACHE_MIDDLEWARE_CLASS
:
class_name
=
WIKI_REQUEST_CACHE_MIDDLEWARE_CLASS
.
split
(
"."
)[
-
1
]
module
=
"."
.
join
(
WIKI_REQUEST_CACHE_MIDDLEWARE_CLASS
.
split
(
'.'
)[:
-
1
])
RequestCache
=
getattr
(
importlib
.
import_module
(
module
),
class_name
)
RequestCache
=
getattr
(
importlib
.
import_module
(
module
),
class_name
)
else
:
else
:
class
_RequestCache
(
threading
.
local
):
class
_RequestCache
(
threading
.
local
):
...
...
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