I'm trying to get started with tgws, Apache 2.2 and Python 2.5 on an XP
box -- could switch to CentOs if that matters. I just cannot get it
started. I'm using tg 1.0.4 (or .8) and created my project using
tg-admin quickstart.
I tried the example in the docs and also tried copying the fixtures into
my controllers module. I get the following errors -- obviously don't
know what I'm doing. Could someone provide a simple example that will
start or clarify what I'm missing. Sorry to be so "needy" but I just
can't get it running.
-------------using the test/fixtures.py in my controllers.py
module---------
>python start-hrapi01.py
2010-02-01 14:33:11,625 tgwebservices.controller INFO registering
complex type <class 'hrapi01.controllers.FancyValue'> for person
2010-02-01 14:33:11,625 tgwebservices.controller INFO registering
complex type <class 'hrapi01.controllers.ReadWriteProperty'> for rwp
Traceback (most recent call last):
File "start-hrapi01.py", line 15, in <module>
start()
File
"C:\All\projects\FredsCernerTools\src\hrapi01\hrapi01\commands.py", line
51, in start
from hrapi01.controllers import Root
ImportError: cannot import name Root
-----------------using the Example from the docs------------
#class EmployeeService(WebServicesController):
class EmployeeService(WebServicesRoot):
@wsexpose(int)
@wsvalidate(int)
def times2(self, value):
"Multiplies value by two."
return value * 2
@wsexpose(int)
@wsvalidate(int)
def twentyover(self, value):
"Divides 20 by value"
return 20 / value
class Root(WebServicesRoot):
hr = EmployeeService("http://localhost:8080") #tried several
variations including Root = ...
>python start-hrapi01.py
2010-02-01 14:33:45,187 tgwebservices.controller INFO registering
complex type <class 'hrapi01.controllers.FancyValue'> for person
2010-02-01 14:33:45,187 tgwebservices.controller INFO registering
complex type <class 'hrapi01.controllers.ReadWriteProperty'> for rwp
Traceback (most recent call last):
File "start-hrapi01.py", line 15, in <module>
start()
File
"C:\All\projects\FredsCernerTools\src\hrapi01\hrapi01\commands.py", line
53, in start
turbogears.start_server(Root())
TypeError: __init__() takes at least 2 arguments (1 given)
--
You received this message because you are subscribed to the Google Groups
"TurboGears" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/turbogears?hl=en.