ldt/web/ldtplatform/wsgi.py
author ymh <ymh.work@gmail.com>
Wed, 19 Sep 2012 01:57:47 +0900
changeset 1 08f6e99af174
child 19 821b602056a8
permissions -rw-r--r--
prepare the installation of the ldt platform
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
1
08f6e99af174 prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff changeset
     1
"""
08f6e99af174 prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff changeset
     2
WSGI config for ldtplatform project.
08f6e99af174 prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff changeset
     3
08f6e99af174 prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff changeset
     4
This module contains the WSGI application used by Django's development server
08f6e99af174 prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff changeset
     5
and any production WSGI deployments. It should expose a module-level variable
08f6e99af174 prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff changeset
     6
named ``application``. Django's ``runserver`` and ``runfcgi`` commands discover
08f6e99af174 prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff changeset
     7
this application via the ``WSGI_APPLICATION`` setting.
08f6e99af174 prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff changeset
     8
08f6e99af174 prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff changeset
     9
Usually you will have the standard Django WSGI application here, but it also
08f6e99af174 prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff changeset
    10
might make sense to replace the whole Django WSGI application with a custom one
08f6e99af174 prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff changeset
    11
that later delegates to the Django one. For example, you could introduce WSGI
08f6e99af174 prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff changeset
    12
middleware here, or combine a Django application with an application of another
08f6e99af174 prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff changeset
    13
framework.
08f6e99af174 prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff changeset
    14
08f6e99af174 prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff changeset
    15
"""
08f6e99af174 prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff changeset
    16
import os
08f6e99af174 prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff changeset
    17
08f6e99af174 prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff changeset
    18
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "ldtplatform.settings")
08f6e99af174 prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff changeset
    19
08f6e99af174 prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff changeset
    20
# This application object is used by any WSGI server configured to use this
08f6e99af174 prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff changeset
    21
# file. This includes Django's development server, if the WSGI_APPLICATION
08f6e99af174 prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff changeset
    22
# setting points here.
08f6e99af174 prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff changeset
    23
from django.core.wsgi import get_wsgi_application
08f6e99af174 prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff changeset
    24
application = get_wsgi_application()
08f6e99af174 prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff changeset
    25
08f6e99af174 prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff changeset
    26
# Apply WSGI middleware here.
08f6e99af174 prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff changeset
    27
# from helloworld.wsgi import HelloWorldApplication
08f6e99af174 prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff changeset
    28
# application = HelloWorldApplication(application)
08f6e99af174 prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff changeset
    29
08f6e99af174 prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff changeset
    30
if os.environ.get('PYDEV_DEBUG', "False").lower() in ["true", "1", "t"]:
08f6e99af174 prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff changeset
    31
    import pydevd #@UnresolvedImport
08f6e99af174 prepare the installation of the ldt platform
ymh <ymh.work@gmail.com>
parents:
diff changeset
    32
    pydevd.settrace(suspend=False)