On Mon, Jan 12, 2009 at 8:02 AM, arnie <[email protected]> wrote:
>
> Hi all
> Using Google App Engine SDK with default port setting of 8080. I have
> two WSGI applications [App1 and App2 both are web services with no UI
> related code in them]. App1 is running on default port 8080. Can dev
> server listens for multiple web applications on same port? If no, then
> what other ports can be used?
> Also these two apps need to access two tables [1 To Many
> relationship], when we go to deploy these apps on GAE do I need
> seperate application ID for these two apps [I think:YES but google
> DOCS says per mobile phone # there is only one app ID]?
> Can these two applications be able to access the common data model or
> do I need to do some special coding for this?
>
One way of handling this is to create a dispatcher. Let's say you have two
apps, and you want App1 to show up at / and App2 at /blog, you could do:
def dispatch_app(environ, start_response):
if environ['PATH_INFO'].startswith('/blog/'):
environ['SCRIPT_NAME'] += '/blog'
environ['PATH_INFO'] = environ['PATH_INFO'][5:]
return App2(environ, start_response)
return App1(environ, start_response)
Then dispatch_app is the WSGI application you are going to actually serve.
Obviously you can abstract out this dispatch code (for an example:
http://svn.pythonpaste.org/Paste/trunk/paste/urlmap.py).
This internal dispatching means all tables are shared.
--
Ian Bicking | http://blog.ianbicking.org
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Google App Engine" 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/google-appengine?hl=en
-~----------~----~----~----~------~----~------~--~---