Re: [cx-freeze-users] cx-freeze on a wsgi app
Brought to you by:
atuining
From: Tony M. <to...@sp...> - 2012-03-20 09:33:41
|
> I would like to ask if there is any chance to generate a python binary with cx-freeze to be used in a web service (in this case in an Apache WSGI). If the answer is yes, how could I do it? The way I've made this work is to use a small "wrapper" for the frozen app, and pointed Apache/mod_wsgi to that. For example: """ import sys sys.path.insert(0, "/path/to/frozen/app/") sys.path.insert(1, "/path/to/frozen/app/library.zip") import frozen_app application = frozen_app.application """ This doesn't use the Python in the frozen version, but it does prefer the packages in the frozen app to any others. If your use-case for cx-freeze is to bundle up all the dependencies together, then this suffices (assuming you have your system Python at the same major version). If you need the actual executable to run, then I couldn't find a way to do that without patching mod_wsgi itself. Cheers, Tony |