[Twisted-Python] twisted web question

I am playing with some twisted-web and woven stuff. I noticed that whenever I get an error page, the server no longer handles requests. Is this the intended behavior? Greg

I had this problem and pointed up to ml some weeks ago... No response for that. I just corrected it by using a TAP file instead of creating the application in my code. Try : ========================================================== mktap web --resource-script=index.rpy ========================================================== then start it with : ========================================================== PYTHONPATH=$PYTHONPATH:$PWD/MyWovenPages twistd -nf web.tap ========================================================== Here is my index.rpy file : ========================================================== # This file is used for debug. It allows to reload the whole application # and test changes directly. import MyWovenPages ## Comment out this line when finished debugging reload(MyWovenPages) # We must have a 'resource'. We take the index page as the default resource. resource = MyWovenPages.MyWovenPages_Index() ========================================================== hope this helped -- Philippe On Tuesday 16 December 2003 00:12, Greg Lappen wrote:
I am playing with some twisted-web and woven stuff.
I noticed that whenever I get an error page, the server no longer handles requests.
Is this the intended behavior?
Greg
_______________________________________________ Twisted-Python mailing list Twisted-Python@twistedmatrix.com http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python

So basically one has to use an rpy file to avoid this issue.... One thing I was wondering about using an rpy file: Does the resource object get instantiated on every request? It seems like this would cause a lot of page objects to be created for every request... Thanks for the tip. Greg On Dec 16, 2003, at 9:33 AM, Philippe Lafoucrière wrote:
I had this problem and pointed up to ml some weeks ago... No response for that. I just corrected it by using a TAP file instead of creating the application in my code. Try :
========================================================== mktap web --resource-script=index.rpy ==========================================================
then start it with :
========================================================== PYTHONPATH=$PYTHONPATH:$PWD/MyWovenPages twistd -nf web.tap ==========================================================
Here is my index.rpy file :
========================================================== # This file is used for debug. It allows to reload the whole application # and test changes directly.
import MyWovenPages
## Comment out this line when finished debugging reload(MyWovenPages)
# We must have a 'resource'. We take the index page as the default resource. resource = MyWovenPages.MyWovenPages_Index() ==========================================================
hope this helped
-- Philippe
On Tuesday 16 December 2003 00:12, Greg Lappen wrote:
I am playing with some twisted-web and woven stuff.
I noticed that whenever I get an error page, the server no longer handles requests.
Is this the intended behavior?
Greg
_______________________________________________ Twisted-Python mailing list Twisted-Python@twistedmatrix.com http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python
_______________________________________________ Twisted-Python mailing list Twisted-Python@twistedmatrix.com http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python

Just thought of something else: If I use mktap and an .rpy script, I cannot install any other protocol factory. My server listens on one port to implement a proprietary TCP/IP protocol, and another port to provide a web interface. Am I right that I cannot set this up using mktap? Greg On Dec 16, 2003, at 9:33 AM, Philippe Lafoucrière wrote:
I had this problem and pointed up to ml some weeks ago... No response for that. I just corrected it by using a TAP file instead of creating the application in my code. Try :
========================================================== mktap web --resource-script=index.rpy ==========================================================
then start it with :
========================================================== PYTHONPATH=$PYTHONPATH:$PWD/MyWovenPages twistd -nf web.tap ==========================================================
Here is my index.rpy file :
========================================================== # This file is used for debug. It allows to reload the whole application # and test changes directly.
import MyWovenPages
## Comment out this line when finished debugging reload(MyWovenPages)
# We must have a 'resource'. We take the index page as the default resource. resource = MyWovenPages.MyWovenPages_Index() ==========================================================
hope this helped
-- Philippe
On Tuesday 16 December 2003 00:12, Greg Lappen wrote:
I am playing with some twisted-web and woven stuff.
I noticed that whenever I get an error page, the server no longer handles requests.
Is this the intended behavior?
Greg
_______________________________________________ Twisted-Python mailing list Twisted-Python@twistedmatrix.com http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python
_______________________________________________ Twisted-Python mailing list Twisted-Python@twistedmatrix.com http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python

At 2003-12-16 10:05 AM -0500, you wrote:
Just thought of something else:
If I use mktap and an .rpy script, I cannot install any other protocol factory. My server listens on one port to implement a proprietary TCP/IP protocol, and another port to provide a web interface. Am I right that I cannot set this up using mktap?
I haven't done it, but according to `mktap --help` you can specify "an existing .tap file to append the plugin to, rather than creating a new one," using -a or --append. I believe this allows you to put multiple applications in the same .tap file, and start up the whole set together. - Sam

So basically one has to use an rpy file to avoid this issue.... One thing I was wondering about using an rpy file: Does the resource object get instantiated on every request? It seems like this would cause a lot of page objects to be created for every request... Thanks for the tip. On Dec 16, 2003, at 9:33 AM, Philippe Lafoucrière wrote:
I had this problem and pointed up to ml some weeks ago... No response for that. I just corrected it by using a TAP file instead of creating the application in my code. Try :
========================================================== mktap web --resource-script=index.rpy ==========================================================
then start it with :
========================================================== PYTHONPATH=$PYTHONPATH:$PWD/MyWovenPages twistd -nf web.tap ==========================================================
Here is my index.rpy file :
========================================================== # This file is used for debug. It allows to reload the whole application # and test changes directly.
import MyWovenPages
## Comment out this line when finished debugging reload(MyWovenPages)
# We must have a 'resource'. We take the index page as the default resource. resource = MyWovenPages.MyWovenPages_Index() ==========================================================
hope this helped
-- Philippe
On Tuesday 16 December 2003 00:12, Greg Lappen wrote:
I am playing with some twisted-web and woven stuff.
I noticed that whenever I get an error page, the server no longer handles requests.
Is this the intended behavior?
Greg
_______________________________________________ Twisted-Python mailing list Twisted-Python@twistedmatrix.com http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python
_______________________________________________ Twisted-Python mailing list Twisted-Python@twistedmatrix.com http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python

On Tuesday 16 December 2003 16:06, Greg Lappen wrote:
So basically one has to use an rpy file to avoid this issue....
One thing I was wondering about using an rpy file:
Does the resource object get instantiated on every request? It seems like this would cause a lot of page objects to be created for every request...
yep, they are created for every request ! that's why you should only use it for dev/debug. -- sry for the twisted-web discussion here guys... (the problem wouldn't appear with a forum, u know... :) )

On Wed, Dec 17, 2003 at 10:30:05AM +0100, Philippe Lafoucri?re wrote:
[snip] sry for the twisted-web discussion here guys... (the problem wouldn't appear with a forum, u know... :) )
_______________________________________________ Twisted-Python mailing list Twisted-Python@twistedmatrix.com http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python

Just thought of something else: If I use mktap and an .rpy script, I cannot install any other protocol factory. My server listens on one port to implement a proprietary TCP/IP protocol, and another port to provide a web interface. Am I right that I cannot set this up using mktap? Greg On Dec 16, 2003, at 9:33 AM, Philippe Lafoucrière wrote:
I had this problem and pointed up to ml some weeks ago... No response for that. I just corrected it by using a TAP file instead of creating the application in my code. Try :
========================================================== mktap web --resource-script=index.rpy ==========================================================
then start it with :
========================================================== PYTHONPATH=$PYTHONPATH:$PWD/MyWovenPages twistd -nf web.tap ==========================================================
Here is my index.rpy file :
========================================================== # This file is used for debug. It allows to reload the whole application # and test changes directly.
import MyWovenPages
## Comment out this line when finished debugging reload(MyWovenPages)
# We must have a 'resource'. We take the index page as the default resource. resource = MyWovenPages.MyWovenPages_Index() ==========================================================
hope this helped
-- Philippe
On Tuesday 16 December 2003 00:12, Greg Lappen wrote:
I am playing with some twisted-web and woven stuff.
I noticed that whenever I get an error page, the server no longer handles requests.
Is this the intended behavior?
Greg
_______________________________________________ Twisted-Python mailing list Twisted-Python@twistedmatrix.com http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python
_______________________________________________ Twisted-Python mailing list Twisted-Python@twistedmatrix.com http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python

On Tue, 2003-12-16 at 10:07, Greg Lappen wrote:
Just thought of something else:
If I use mktap and an .rpy script, I cannot install any other protocol factory. My server listens on one port to implement a proprietary TCP/IP protocol, and another port to provide a web interface. Am I right that I cannot set this up using mktap?
If you use mktap web, yes. So don't use it. -- Itamar Shtull-Trauring http://itamarst.org Looking for a job: http://itamarst.org/resume.html
participants (6)
-
Greg Lappen
-
Greg Lappen
-
Itamar Shtull-Trauring
-
Jp Calderone
-
Philippe Lafoucrière
-
Samuel Reynolds