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
dad70c5a
Commit
dad70c5a
authored
Jan 13, 2012
by
Piotr Mitros
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Proper from addresses, static view allows CSRF
parent
55c10212
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
4 deletions
+9
-4
settings.py
+2
-2
static_template_view/views.py
+7
-2
No files found.
settings.py
View file @
dad70c5a
...
@@ -7,8 +7,8 @@ if not COURSEWARE_ENABLED:
...
@@ -7,8 +7,8 @@ if not COURSEWARE_ENABLED:
EMAIL_BACKEND
=
'django.core.mail.backends.console.EmailBackend'
EMAIL_BACKEND
=
'django.core.mail.backends.console.EmailBackend'
SITE_NAME
=
"localhost:8000"
SITE_NAME
=
"localhost:8000"
DEFAULT_FROM_EMAIL
=
'
nobody@localhost
'
DEFAULT_FROM_EMAIL
=
'
registration@mitx.mit.edu
'
DEFAULT_FEEDBACK_EMAIL
=
'
nobody@localhost
'
DEFAULT_FEEDBACK_EMAIL
=
'
feedback@mitx.mit.edu
'
WIKI_REQUIRE_LOGIN_EDIT
=
True
WIKI_REQUIRE_LOGIN_EDIT
=
True
WIKI_REQUIRE_LOGIN_VIEW
=
True
WIKI_REQUIRE_LOGIN_VIEW
=
True
...
...
static_template_view/views.py
View file @
dad70c5a
...
@@ -6,11 +6,16 @@
...
@@ -6,11 +6,16 @@
from
djangomako.shortcuts
import
render_to_response
,
render_to_string
from
djangomako.shortcuts
import
render_to_response
,
render_to_string
from
django.shortcuts
import
redirect
from
django.shortcuts
import
redirect
valid_templates
=
[
'index.html'
,
'staff.html'
,
'info.html'
,
'credits.html'
]
from
auth.views
import
csrf
#valid_templates=['index.html', 'staff.html', 'info.html', 'credits.html']
valid_templates
=
[
'mitx.html'
,
'index.html'
,
'courseinfo.html'
]
def
index
(
request
,
template
):
def
index
(
request
,
template
):
csrf_token
=
csrf
(
request
)[
'csrf_token'
]
if
template
in
valid_templates
:
if
template
in
valid_templates
:
return
render_to_response
(
template
,{})
return
render_to_response
(
template
,{
'error'
:
''
,
'csrf'
:
csrf_token
})
else
:
else
:
return
redirect
(
'/'
)
return
redirect
(
'/'
)
...
...
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