Django documentation says to use:
WSGIScriptAlias / /path/to/mysite.com/mysite/wsgi.py
WSGIPythonPath /path/to/mysite.com
<Directory /path/to/mysite.com/mysite>
<Files wsgi.py>
Require all granted
class Wrapper(object): | |
def __init__(self, wrapped): | |
self.__wrapped__ = wrapped | |
@property | |
def __call__(self): | |
return self.__wrapped__.__call__ | |
>>> wrapper = Wrapper(None) |
class Router(object): | |
def __init__(self): | |
self.methods = {} | |
def route(self, url): | |
def decorator(wrapped): | |
wrapped.__route_info__ = (self, url) | |
return wrapped | |
return decorator | |
def register(self, url, method): | |
self.methods[url] = method |
# This is example configuration of how a specific sub URL of a Python | |
# web application can be delegated to run in mod_wsgi embedded mode | |
# where the remainder of the site is delegated to run in mod_wsgi | |
# daemon mode. | |
# | |
# The particular example in this case is to work around the current | |
# issue that the optional enabling of non WSGI handling of chunked | |
# request content doesn't work for mod_wsgi daemon mode. A fix for | |
# that has been developed but hasn't yet been released. As Linux | |
# distributions ship older mod_wsgi versions and do not update them, |
Django documentation says to use:
WSGIScriptAlias / /path/to/mysite.com/mysite/wsgi.py
WSGIPythonPath /path/to/mysite.com
<Directory /path/to/mysite.com/mysite>
<Files wsgi.py>
Require all granted
Note that for client authentication the very latest mod_wsgi-express
version is required.
For now this means installing from from the git repo. To install run:
pip install -U https://github.com/GrahamDumpleton/mod_wsgi/archive/develop.zip
To create a self signed server certificate so that can run HTTPS use:
# exports.py | |
import sys | |
class Exports(object): | |
def __getattr__(self, name): | |
context = sys._getframe().f_back.f_globals | |
return context[name] |
# Can't get class via stack frame as only have access to code object and not what type it may have been bound to if a function. | |
>>> def func(): | |
... print sys._getframe().f_code.co_name | |
... | |
>>> func() | |
func | |
>>> class A(object): | |
... def method(self): | |
... print sys._getframe().f_code.co_name |