Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add example
twisted.cfg
buildout configuration and cone.tac
t…
…wisted configuration file for running cone with twisted WSGI.
- Loading branch information
Showing
6 changed files
with
67 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,6 +5,7 @@ | |
/.pydevproject | ||
/.pydevproject.bak | ||
/.settings/ | ||
/twistd.pid | ||
/src/cone.app.egg-info/ | ||
/bin/ | ||
/env/ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import os | ||
from twisted.web.server import Site | ||
from twisted.web.wsgi import WSGIResource | ||
from twisted.internet import reactor | ||
from twisted.application import ( | ||
internet, | ||
service, | ||
) | ||
from pyramid.paster import get_app | ||
|
||
|
||
config='./cone.ini' | ||
config = os.path.abspath(config) | ||
port = 8081 | ||
|
||
|
||
# Get the WSGI application | ||
myApp = get_app(config, 'main') | ||
|
||
# Twisted WSGI server setup | ||
resource = WSGIResource(reactor, reactor.getThreadPool(), myApp) | ||
factory = Site(resource) | ||
|
||
# Twisted Application setup | ||
application = service.Application('cone') | ||
internet.TCPServer(port, factory).setServiceParent(application) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
[buildout] | ||
extends = base.cfg | ||
|
||
parts += instance | ||
|
||
[instance] | ||
recipe = zc.recipe.egg:scripts | ||
dependent-scripts = true | ||
eggs = | ||
cone.app |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
[buildout] | ||
extends = base.cfg | ||
|
||
parts += scripts | ||
|
||
[twisted] | ||
recipe = zc.recipe.egg | ||
eggs = | ||
Twisted | ||
|
||
[config] | ||
app = cone.app | ||
eggs = cone.app | ||
|
||
[scripts] | ||
recipe = minitage.recipe.scripts | ||
interpreter = python | ||
|
||
# Add our package source to the python path to allow twisted TAPs to be | ||
# accessible at runtime. | ||
extra-paths = ${buildout:directory}/${config:app} | ||
|
||
eggs = | ||
${config:eggs} | ||
${twisted:eggs} |