listener/app_engine/appengine_django/__init__.py
def InstallDjangoModuleReplacements():
  """Replaces internal Django modules with App Engine compatible versions."""

  # Replace the session module with a partial replacement overlay using
  # __path__ so that portions not replaced will fall through to the original
  # implementation.
  try:
    from django.contrib import sessions
    orig_path = sessions.__path__[0]
    sessions.__path__.insert(0, os.path.join(DIR_PATH, 'sessions'))
    from django.contrib.sessions import backends
    backends.__path__.append(os.path.join(orig_path, 'backends'))
  except ImportError:
    logging.debug("No Django session support available")

  # Replace incompatible dispatchers.
  import django.core.signals
  import django.db
  import django.dispatch.dispatcher

  # Rollback occurs automatically on Google App Engine. Disable the Django
  # rollback handler.
  try:
    # pre 1.0
    from django.dispatch import errors
    CheckedException = errors.DispatcherKeyError
    def _disconnectSignal():
      django.dispatch.dispatcher.disconnect(
          django.db._rollback_on_exception,
          django.core.signals.got_request_exception)
  except ImportError:
    CheckedException = KeyError
    def _disconnectSignal():
      django.core.signals.got_request_exception.disconnect(
          django.db._rollback_on_exception)

  try:
    _disconnectSignal()
  except CheckedException, e:
    logging.debug("Django rollback handler appears to be already disabled.")
Replaces internal Django modules with App Engine compatible versions.
Replaces internal Django modules with App Engine compatible versions.
Replaces internal Django modules with App Engine compatible versions .
def InstallDjangoModuleReplacements():
  try:
    from django.contrib import sessions
    orig_path = sessions.__path__[0]
    sessions.__path__.insert(0, os.path.join(DIR_PATH, 'sessions'))
    from django.contrib.sessions import backends
    backends.__path__.append(os.path.join(orig_path, 'backends'))
  except ImportError:
    logging.debug("No Django session support available")
  import django.core.signals
  import django.db
  import django.dispatch.dispatcher
  try:
    from django.dispatch import errors
    CheckedException = errors.DispatcherKeyError
    def _disconnectSignal():
      django.dispatch.dispatcher.disconnect(
          django.db._rollback_on_exception,
          django.core.signals.got_request_exception)
  except ImportError:
    CheckedException = KeyError
    def _disconnectSignal():
      django.core.signals.got_request_exception.disconnect(
          django.db._rollback_on_exception)
  try:
    _disconnectSignal()
  except CheckedException, e:
    logging.debug("Django rollback handler appears to be already disabled.")
def InstallDjangoModuleReplacements ( ) : try : from django . contrib import sessions orig_path = sessions . __path__ [ 0 ] sessions . __path__ . insert ( 0 , os . path . join ( DIR_PATH , 'sessions' ) ) from django . contrib . sessions import backends backends . __path__ . append ( os . path . join ( orig_path , 'backends' ) ) except ImportError : logging . debug ( "No Django session support available" ) import django . core . signals import django . db import django . dispatch . dispatcher try : from django . dispatch import errors CheckedException = errors . DispatcherKeyError def _disconnectSignal ( ) : django . dispatch . dispatcher . disconnect ( django . db . _rollback_on_exception , django . core . signals . got_request_exception ) except ImportError : CheckedException = KeyError def _disconnectSignal ( ) : django . core . signals . got_request_exception . disconnect ( django . db . _rollback_on_exception ) try : _disconnectSignal ( ) except CheckedException , e : logging . debug ( "Django rollback handler appears to be already disabled." )
Replaces internal Django modules with App Engine compatible versions.
Replaces internal Django modules with App Engine compatible versions .
"""Replaces internal Django modules with App Engine compatible versions.""" # Replace the session module with a partial replacement overlay using # __path__ so that portions not replaced will fall through to the original # implementation. # Replace incompatible dispatchers. # Rollback occurs automatically on Google App Engine. Disable the Django # rollback handler. # pre 1.0