[Twisted-web] deployment with twistd of simple web application
Axel Rau
Axel.Rau at Chaos1.DE
Tue Nov 5 05:43:50 MST 2013
Am 05.11.2013 um 13:25 schrieb Laurens Van Houtven <_ at lvh.io>:
> You probably want to read this:
>
> https://twistedmatrix.com/documents/current/core/howto/application.html
This explains the echo service step by step, but I still do not know how to do it with twistd *web* .
Looking at the source of the web plugin did not enlighten me.
I tried:
---
meteo.tac:
---
application = service.Application('meteo')
meteoService = internet.TCPserver(80, meteoFactory(), interface=some IP4')
# interface='some IP 6')
meteoService.setServiceParent(application)
---
and changed my main module to
---
…
resource = RootWeatherPage()
meteoFactory = Site(resource)
#reactor.listenTCP(80, factory, interface='91.216.35.82')
#reactor.listenTCP(80, factory, interface='2a02:d40:2:2::82')
#reactor.run()…
---
twisted does not start up. Interrupting it, gives
"exceptions.ImportError: cannot import name meteoFactory"
>
> There's a number of ways you can use twistd web, for example with a tac file, but personally I always opt for using a Twisted plugin, so you instead do twistd mything :)
Axel
---
PGP-Key:29E99DD6 ☀ +49 151 2300 9283 ☀ computing @ chaos claudius
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://twistedmatrix.com/pipermail/twisted-web/attachments/20131105/a5024ad4/attachment.html>
More information about the Twisted-web
mailing list