Cherrypy site organization

6 views
Skip to first unread message

as

unread,
Feb 15, 2005, 10:58:53 PM2/15/05
to cherryp...@googlegroups.com
I start playing around with cherrypy and it's great but I have a
question if I have a couple of independent files do I have to put them
together or I can run separately?

Remi Delon

unread,
Feb 16, 2005, 9:26:20 AM2/16/05
to cherryp...@googlegroups.com
> I start playing around with cherrypy and it's great but I have a
> question if I have a couple of independent files do I have to put them
> together or I can run separately?

Just organise your files like a regular python application ...
You can have as many .py files as you want, as long as they get imported.

Remi.

as

unread,
Feb 16, 2005, 10:44:46 AM2/16/05
to cherryp...@googlegroups.com
Hi
can you give me example.What I am trying to get is something similiar
with Tomcat.
/webapps/app1
/webapps/app2
/webapps/app3

Remi Delon

unread,
Feb 16, 2005, 11:10:05 AM2/16/05
to cherryp...@googlegroups.com
as wrote:
> Hi
> can you give me example.What I am trying to get is something similiar
> with Tomcat.
> /webapps/app1
> /webapps/app2
> /webapps/app3

well, you could do this:

== file app1.py ==
from cherrypy import cpg
class Root:
def index(self):
...

== file app2.py ==
from cherrypy import cpg
class Root:
def index(self):
...

== file app3.py ==
from cherrypy import cpg
class Root:
def index(self):
...

== file main.py ==
from cherrypy import cpg
import app1, app2, app3
cpg.root.app1 = app1.Root()
cpg.root.app2 = app2.Root()
cpg.root.app3 = app3.Root()
cpg.server.start()

Remi.
Reply all
Reply to author
Forward
0 new messages