Can a python webapp be bundled into a single file for deployment?
Is it possible for a python webapp to be bundled (gzipped?) into a single file, along w开发者_开发技巧ith any required resources (js/css files) & modules (including modules like lxml which are mostly C-based), for easy deployment onto a linux webserver?
Yes. You can create a windows executable using py2exe
. A better way to manage deployment is to package your app with a setup.py
file, listing all needed dependencies, and listing non-python support files in the MANIFEST.in
file. Then you can package it into a bundle using setup.py sdist
, and install it with pip
. See Tarek Ziade's Hitchhiker's Guide to Packaging for more details.
For standalones ,you could try :
OS X : py2app
For Windows py2exe.
Not sure if this would apply to your 'webapp' though.
PyInstaller is perhaps the best cross-platform packager (in the SVN trunk version: 1.3, the latest packaged release, is very old and crufty -- no idea why my friends who took over maintenance over a year ago and did so many enhancements keep resisting my entreaties to make another release, already!-) -- you can package for Windows, Linux or Mac, and it directly supports many popular third-party packages too.
精彩评论