Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
edx-platform
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
edx-platform
Commits
768c0853
Commit
768c0853
authored
Jan 29, 2012
by
Piotr Mitros
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
We can now use Amazon S3
parent
c99bc566
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
15 additions
and
0 deletions
+15
-0
mitxmako/middleware.py
+7
-0
mitxmako/shortcuts.py
+5
-0
settings_new_askbot.py
+3
-0
No files found.
mitxmako/middleware.py
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
):
...
...
@@ -39,3 +42,7 @@ class MakoMiddleware(object):
import
mitxmako
mitxmako
.
lookup
=
lookup
def
process_request
(
self
,
request
):
global
requestcontext
requestcontext
=
RequestContext
(
request
)
# print requestcontext
mitxmako/shortcuts.py
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
...
...
settings_new_askbot.py
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
()
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