Commit 31c921f0 by Ned Batchelder

Add more detail in docstring

parent eda7db19
"""Django integration for codejail"""
"""Django integration for codejail.
Code to glue codejail into a Django environment.
"""
from django.core.exceptions import MiddlewareNotUsed
from django.conf import settings
......@@ -7,8 +11,14 @@ import codejail.jail_code
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):
python_bin = settings.CODE_JAIL.get('python_bin')
if python_bin:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment