v+python | 3 Dec 02:33
Favicon

This post can be deleted


I'm just checking to see if I'm still in moderation limbo... my
previous post hasn't appeared yet.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "cherrypy-users" group.
To post to this group, send email to cherrypy-users@...
To unsubscribe from this group, send email to cherrypy-users+unsubscribe@...
For more options, visit this group at http://groups.google.com/group/cherrypy-users?hl=en
-~----------~----~----~----~------~----~------~--~---

RichardC | 3 Dec 01:05

Re: Multiple ports and SSL


So it turns out that if you create two instances of CherryPyWSGIServer
they will share the same environment dictionary 'environ', which
causes problem when one is for HTTP and the other is for HTTPS. This
confused the hell out of me all morning. Here is the change so they
have separate 'environ's.

diff -ru cherrypyp1/wsgiserver/__init__.py cherrypyp2/wsgiserver/
__init__.py
--- cherrypyp1/wsgiserver/__init__.py	2008-12-01 13:36:18.000000000
+1300
+++ cherrypyp2/wsgiserver/__init__.py	2008-12-03 12:56:33.000000000
+1300
@@ -1464,7 +1464,7 @@
     nodelay = True

     ConnectionClass = HTTPConnection
-    environ = {}
+    environ = None

     # Paths to certificate and private key files
     ssl_certificate = None
@@ -1474,6 +1474,9 @@
                  max=-1, request_queue_size=5, timeout=10,
shutdown_timeout=5):
         self.requests = ThreadPool(self, min=numthreads or 1,
max=max)

+        if not self.environ:
+            self.environ = {}
(Continue reading)

Re: Html tags are displayed as plain text and not rendered as html


It does not need to write HTML file as the mentiioned, only not
conformed:-(
The following could be rendered  as HTML File without problem, if you
tell the server this is html format!
<form action="#">
what's your name?
<input type="text" name="name">
<input type="submit"/>
</form>

On Dec 2, 3:16 pm, "Stefan J. Betz" <stefan_b...@...> wrote:
> Am 2008-12-01 14:59:21 -0800, foobar schrieb:
>
> > Hello, I am new to CherryPy, I'm running Fedora 8 linux with apache
> > and trying the tutorial files, they dont't work.
>
> > Html tags are displayed as plain text and not rendered as html.
> > Here is a screenshot
> >http://foobar.pri.ee/pildid/cherrypy.png
>
> You know that a minimal HTML File looks like this one:
> --- CUT ---
> <html>
> <head>
> <title>You Title Here</title>
> </head>
> <body>
> INSERT YOUR FORM HERE
> </body>
(Continue reading)

Re: Logging to screen with a WSGI application...


Hi,

When hosting a WSGI application you don't go through the full CherryPy
engine stack and therefore you don't have access to some functionnalities
such as logging.

Here you should just wrap your application into a WSGI middleware that
provides what you need, look for instance at the Paste translogger.

http://pythonpaste.org/modules/translogger.html#module-paste.translogger

- Sylvain

>
> I have a WSGI application which I'm using CherryPy as the server for.
>
> It seems to work well, except exceptions are not logged to the
> screen---or anywhere else!
>
> When I swap out cherrypy with the wsgiref.simple_server, exceptions
> are logged to the screen.
>
> This is cherrypy 3.1.1.
>
> If I print out the default value for cherrypy.log.screen, it is set to
> True.
>
> My understanding is there is also a log.screen variable for each
> application?  How do I access this to see what it is set to?
(Continue reading)

foobar | 1 Dec 23:58

Html tags are displayed as plain text and not rendered as html


Hello, I am new to CherryPy, I'm running Fedora 8 linux with apache
and trying the tutorial files, they dont't work.

Html tags are displayed as plain text and not rendered as html.
Here is a screenshot
http://foobar.pri.ee/pildid/cherrypy.png

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "cherrypy-users" group.
To post to this group, send email to cherrypy-users@...
To unsubscribe from this group, send email to cherrypy-users+unsubscribe@...
For more options, visit this group at http://groups.google.com/group/cherrypy-users?hl=en
-~----------~----~----~----~------~----~------~--~---

daniels | 1 Dec 07:11

Is CherryPy the right tool for a CPanel like application?


Hi,
For quite a few time I wanted to start a pet project that will aim in
time to have CPanel functionality but mainly focused on python hosting
meaning i would like to make a way for users to generate/start Django/
other frameworks projects right from the panel and i seemed to have
found the perfect tool to build my app with it, CherryPy. This would
allow me to do it the way I want, building the app with it's own HTTP/
HTTPS server and also all in my favorite programming language.
But now a new question arises, CherryPy being a threaded server will
it be the right for this kind of task?
Because there will be lots of time consuming tasks so if one of the
tasks blocks, the rest of the users trying to access other pages will
be left waiting eventually getting timed out.

I imagine that such kind of problem wouldn't happen on a fork server.

What would you advise?

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "cherrypy-users" group.
To post to this group, send email to cherrypy-users@...
To unsubscribe from this group, send email to cherrypy-users+unsubscribe@...
For more options, visit this group at http://groups.google.com/group/cherrypy-users?hl=en
-~----------~----~----~----~------~----~------~--~---

dundeemt | 26 Nov 06:04

Re: _cpconfig.py - staging ~ production environments


On Nov 25, 10:04 am, "Robert Brewer" <fuman...@...> wrote:
> dundeemt wrote:
> > Wondering why the 'staging' environment has autoreload and other
> > logging turned off by default
>
> >http://www.cherrypy.org/browser/trunk/cherrypy/_cpconfig.py#L108
>
> > note how staging and production only differ with production adding the
> > log.screen:False option
> > 106        environments = {
> > 107            "staging": {
> > 108                'engine.autoreload_on': False,
> > 109                'checker.on': False,
> > 110                'tools.log_headers.on': False,
> > 111                'request.show_tracebacks': False,
> > 112                },
> > 113            "production": {
> > 114                'engine.autoreload_on': False,
> > 115                'checker.on': False,
> > 116                'tools.log_headers.on': False,
> > 117                'request.show_tracebacks': False,
> > 118                'log.screen': False,
> > 119                },
>
> > Am I misinterpreting what 'staging' means in this context?  Are
> > environments kind of a "left-over" being overtaken by site.conf and
> > app.conf?
>
> No; environments are like "macros" for config. The staging environment
(Continue reading)

Gravatar

Re: CherryPy Log.screen?


On Tue, Nov 25, 2008 at 5:02 PM, Patrick Adair
<patrick.adair@...> wrote:
> I've been messing around with the config files for our CherryPy
> server, and I noticed something odd: say I have my server start script
> at start-server.py, and a config file at tests.conf that is loaded
> when I run my unit tests.
>
> I'm trying to stop CherryPy from filling Eclipse's output console with
> lines of debug output; if I put
> `cherrypy.config.update({'log.screen': False})` in start-server.py,
> then the output is suppressed and everyone is happy. However, if I put
> `log.screen: False` in the config file (tried it in global, '/', and
> other path configs), then it will show me all the output.
>
> My team would infinitely prefer to have all these config options in
> the .conf file instead of the Python script; is there any halp for us?

You should probably have two config files - one for server-wide
settings (like log.screen) and one for the application itself.  You
can pass a config file to cherrypy.config.update just like you pass a
dictionary.

HTH,

Christian
http://www.dowski.com

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "cherrypy-users" group.
(Continue reading)

dundeemt | 25 Nov 14:39

ThreadManager and subscribing


I am confused as to the proper way to handle subscribing to threads in
embedded mode.

If running standalone CP, then you should subscribe to start_thread/
stop_thread, correct?

But if you are running under Apache you should subscribe to
acquire_thread and ?stop_thread?

from the ThreadManager docstring:
If threads are created and destroyed by code you do not control

    (e.g., Apache), then, at the beginning of every HTTP request,

    publish to 'acquire_thread' only. You should not publish to

    'release_thread' in this case, since you do not know whether

    the thread will be re-used or not. The bus will call

    'stop_thread' listeners for you when it stops.

-Jeff
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "cherrypy-users" group.
To post to this group, send email to cherrypy-users@...
To unsubscribe from this group, send email to cherrypy-users+unsubscribe@...
For more options, visit this group at http://groups.google.com/group/cherrypy-users?hl=en
-~----------~----~----~----~------~----~------~--~---
(Continue reading)

Pete H | 25 Nov 11:35

Re: scaffold/cpdeploy.py - cherryd - DeployTemplate


On Nov 24, 2:26 pm, dundeemt <dunde...@...> wrote:
> On Nov 24, 3:32 am, Pete H <pe...@...> wrote:
<snip>

>
> Pete,
> Thank you for your example.  I'm just starting to go over it now.  I
> am sure to learn much from it.
>
> Do you know if subscribing to 'start_thread'/'stop_thread' needs any
> modification over the different deployment scenarios?  I will be using
> mysql and I'd like to explicitly close down db connections before
> threads go away.http://tools.cherrypy.org/wiki/Databases

Not as far as I know, though it's only been live with cgi and
mod_wsgi. Obviously the threads issue doesn't arise with cgi.

I'm using the recipe in the wiki with the psycopg2 driver - seems to
be the only one that's current at the moment anyway. So far it 'just
works'.

I should add that so far my database is read-only - though when it
does become read/write I don't expect many concurrent connections
since the only write operations will be by the society secretary and
those members registering stock - and out of say 1000 members there
won't be many doing that at the same time.

In fact since mod_wsgi works so well (thanks Graham!) I can't really
envisage ever going back to mod_python since it's no good for me in a
(Continue reading)

Gravatar

Re: Unrecoverable error in the server.


On Mon, Nov 24, 2008 at 11:47 AM, Darren Govoni <darren@...> wrote:
> I also added:
>  cherrypy.tree.mount(Root(),'myapp')

My mistake!  I meant to type '/myapp'.  See if that helps.

Christian
http://www.dowski.com

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "cherrypy-users" group.
To post to this group, send email to cherrypy-users@...
To unsubscribe from this group, send email to cherrypy-users+unsubscribe@...
For more options, visit this group at http://groups.google.com/group/cherrypy-users?hl=en
-~----------~----~----~----~------~----~------~--~---


Gmane