Created
July 22, 2013 17:25
-
-
Save sunu/6055780 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
### We must chdir() up one level. | |
import os | |
import os.path | |
import sys | |
THIS_FILE=os.path.abspath(__file__) | |
THIS_DIR=os.path.dirname(THIS_FILE) | |
UP_ONE_DIR=os.path.join(THIS_DIR, '..') | |
sys.path.append(UP_ONE_DIR) | |
# Use the modules in vendor/ | |
import vendor | |
vendor.vendorify() | |
# Now we can import from third-party libraries. | |
from django.core.management import execute_manager, setup_environ | |
import mysite.settings | |
# The first thing execute_manager does is call `setup_environ`. | |
setup_environ(mysite.settings) | |
import django.core.handlers.wsgi | |
application = django.core.handlers.wsgi.WSGIHandler() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from werkzeug.serving import run_simple | |
from mysite.wsgi import application as ohapp | |
import os | |
import os.path | |
import sys | |
THIS_FILE=os.path.abspath(__file__) | |
THIS_DIR=os.path.dirname(THIS_FILE) | |
OPPIA_DIR=os.path.join(THIS_DIR, '/oppia') | |
sys.path.append(OPPIA_DIR) | |
from main import app as oppia_app | |
from werkzeug.wsgi import DispatcherMiddleware | |
app2.debug = True | |
application = DispatcherMiddleware(ohapp, { | |
'/missions': oppia_app | |
}) | |
if __name__ == '__main__': | |
run_simple('localhost', 5000, application, | |
use_reloader=True, use_debugger=True, use_evalex=True) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment