Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
C
codejail
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
codejail
Commits
31c921f0
Commit
31c921f0
authored
May 02, 2013
by
Ned Batchelder
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add more detail in docstring
parent
eda7db19
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
2 deletions
+12
-2
codejail/django_integration.py
+12
-2
No files found.
codejail/django_integration.py
View file @
31c921f0
"""Django integration for codejail"""
"""Django integration for codejail.
Code to glue codejail into a Django environment.
"""
from
django.core.exceptions
import
MiddlewareNotUsed
from
django.core.exceptions
import
MiddlewareNotUsed
from
django.conf
import
settings
from
django.conf
import
settings
...
@@ -7,8 +11,14 @@ import codejail.jail_code
...
@@ -7,8 +11,14 @@ import codejail.jail_code
class
ConfigureCodeJailMiddleware
(
object
):
class
ConfigureCodeJailMiddleware
(
object
):
"""Middleware to configure codejail on startup."""
"""
Middleware to configure codejail on startup.
This is a Django idiom to have code run once on server startup: put the
code in the `__init__` of some middleware, and have it do the work, then
raise `MiddlewareNotUsed` to disable the middleware.
"""
def
__init__
(
self
):
def
__init__
(
self
):
python_bin
=
settings
.
CODE_JAIL
.
get
(
'python_bin'
)
python_bin
=
settings
.
CODE_JAIL
.
get
(
'python_bin'
)
if
python_bin
:
if
python_bin
:
...
...
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