redirect http to https in twisted
问题 I'm running a django app using twisted. I moved now from http to https. How can I add redirects from http to https in twisted? 回答1: An easy way to generate redirects in Twisted Web is is with the Redirect resource. Instantiate it with a URL and put it into your resource hierarchy. If it is rendered, it will return a redirect response to that URL: from twisted.web.util import Redirect from twisted.web.resource import Resource from twisted.web.server import Site from twisted.internet import