Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
edx-platform-release
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Hsin-Yu Chien
edx-platform-release
Commits
768c0853
Commit
768c0853
authored
13 years ago
by
Piotr Mitros
Browse files
Options
Downloads
Patches
Plain Diff
We can now use Amazon S3
parent
c99bc566
Loading
Loading
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
mitxmako/middleware.py
+8
-1
8 additions, 1 deletion
mitxmako/middleware.py
mitxmako/shortcuts.py
+5
-0
5 additions, 0 deletions
mitxmako/shortcuts.py
settings_new_askbot.py
+3
-0
3 additions, 0 deletions
settings_new_askbot.py
with
16 additions
and
1 deletion
mitxmako/middleware.py
+
8
−
1
View file @
768c0853
...
...
@@ -14,6 +14,9 @@
from
mako.lookup
import
TemplateLookup
import
tempfile
from
django.template
import
RequestContext
requestcontext
=
None
class
MakoMiddleware
(
object
):
def
__init__
(
self
):
...
...
@@ -38,4 +41,8 @@ class MakoMiddleware(object):
)
import
mitxmako
mitxmako
.
lookup
=
lookup
def
process_request
(
self
,
request
):
global
requestcontext
requestcontext
=
RequestContext
(
request
)
# print requestcontext
This diff is collapsed.
Click to expand it.
mitxmako/shortcuts.py
+
5
−
0
View file @
768c0853
...
...
@@ -16,6 +16,9 @@ from django.template import Context
from
django.http
import
HttpResponse
import
middleware
from
django.conf
import
settings
from
mitxmako.middleware
import
requestcontext
def
render_to_string
(
template_name
,
dictionary
,
context_instance
=
None
):
context_instance
=
context_instance
or
Context
(
dictionary
)
...
...
@@ -23,6 +26,8 @@ def render_to_string(template_name, dictionary, context_instance=None):
context_instance
.
update
(
dictionary
or
{})
# collapse context_instance to a single dictionary for mako
context_dictionary
=
{}
context_instance
[
'
settings
'
]
=
settings
context_instance
[
'
request_context
'
]
=
requestcontext
for
d
in
context_instance
:
context_dictionary
.
update
(
d
)
# fetch and render template
...
...
This diff is collapsed.
Click to expand it.
settings_new_askbot.py
+
3
−
0
View file @
768c0853
...
...
@@ -4,7 +4,9 @@ import sys
import
djcelery
LIB_URL
=
'
/static/lib/
'
LIB_URL
=
'
http://mitxstatic.s3-website-us-east-1.amazonaws.com/js/
'
BOOK_URL
=
'
/static/book/
'
BOOK_URL
=
'
http://mitxstatic.s3-website-us-east-1.amazonaws.com/book_images/
'
# Our parent dir (mitx_all) is the BASE_DIR
BASE_DIR
=
os
.
path
.
abspath
(
os
.
path
.
join
(
__file__
,
"
..
"
,
"
..
"
))
...
...
@@ -327,3 +329,4 @@ BROKER_TRANSPORT = "djkombu.transport.DatabaseTransport"
CELERY_ALWAYS_EAGER
=
True
djcelery
.
setup_loader
()
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment