1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
|
# Copyright 2010 Canonical Ltd. This software is licensed under the
# GNU Affero General Public License version 3 (see the file LICENSE).
from SocketServer import ThreadingMixIn
from wsgiref.simple_server import WSGIServer, make_server
import os
import sys
sys.path.insert(0, os.path.abspath('django_project'))
os.environ['DJANGO_SETTINGS_MODULE'] = 'settings'
from identityprovider.wsgi import make_app
class ThreadedWSGIServer(ThreadingMixIn, WSGIServer):
pass
httpd = make_server('', 8000, make_app(), server_class=ThreadedWSGIServer)
print "Serving HTTP on port 8000..."
# Respond to requests until process is killed
httpd.serve_forever()
|