How to use twistedweb with django on windows
I'm looking for a super easy way to deploy django application on windows.
Basically my plan is t开发者_如何转开发o set up any python web server with my app on it and the boundle everything together using py2exe into a single executable.
I've tried using cherrypy however the newest (3.1.2) server doesn't work with Windows XP with Nod32 antivirus installed.
So I decided to give a try to Twisted. I've only found Django On Twisted but it seams to be quite old (2008) and it use twistd command which is a bit hard to pack into single executable.
Has anyone got a working snipped or good source of info?
I've found quite nice blog entry describing how to run django on twisted trunk.
Here is an example that merge twisted with django app into one file so it can be used from file created by py2exe:
# bootstrap your django instance
from django.core.handlers.wsgi import WSGIHandler
application = WSGIHandler()
import sys
sys.argv += '-no web --wsgi=<module_name>.application --port=8081'.split()
from twisted.scripts.twistd import run
run()
I would rather suggest Portable LightTPD (i.e. the .zip) and Portable Python. It is very easy to set up LightTPD for FastCGI, and very easy to set up sqlite and FastCGI with Django in the Portable Python distro. This is probably your fastest and simplest route to getting an easily-deployable Django app going. If you aren't using it already, you probably want the Django book to help speed things along.
Instant Django has Python 2.6.2 integrated, so perhaps that would serve your needs better.
精彩评论