# HG changeset patch # User Paul Boddie # Date 1219603870 -7200 # Node ID c74377ab32be7ae652b87fcf831ecf5d023e033f # Parent 8c54afdd38ce2e62e751f6200182122e3fc41309 Fixed DirectoryRepository to create the directory if missing. Changed the SimpleWithLogin example to provide the full site map, altering the specific deployments accordingly. Changed the demo to make use of the revised SimpleWithLogin and new SimpleWithOpenID examples. diff -r 8c54afdd38ce -r c74377ab32be WebStack/Repositories/Directory.py --- a/WebStack/Repositories/Directory.py Sat May 24 15:21:53 2008 +0000 +++ b/WebStack/Repositories/Directory.py Sun Aug 24 20:51:10 2008 +0200 @@ -56,6 +56,7 @@ # Create a directory and initialise it with a special file. if not os.path.exists(path): + os.mkdir(path) self.create_resource(self.full_path(self.new_filename)) # Guess the filesystem encoding. diff -r 8c54afdd38ce -r c74377ab32be examples/BaseHTTPRequestHandler/SimpleWithLoginApp.py --- a/examples/BaseHTTPRequestHandler/SimpleWithLoginApp.py Sat May 24 15:21:53 2008 +0000 +++ b/examples/BaseHTTPRequestHandler/SimpleWithLoginApp.py Sun Aug 24 20:51:10 2008 +0200 @@ -1,35 +1,25 @@ #!/usr/bin/env python from WebStack.Adapters.BaseHTTPRequestHandler import deploy -from WebStack.Resources.LoginRedirect import LoginRedirectResource, LoginRedirectAuthenticator -from WebStack.Resources.Login import LoginResource, LoginAuthenticator -from WebStack.Resources.ResourceMap import MapResource -from Simple import SimpleResource +from SimpleWithLogin import get_site_map + +# Change this to be the exact URL. +# eg. http://localhost:8000/myapp/login + +login_url = "http://localhost:8080/login" + +# Change this to be the URL base for your server. +# eg. http://localhost:8000 + +app_url = "http://localhost:8080" # No trailing "/"! + +# Must match the key used elsewhere. + +secret_key = "horses" # Must match the login authenticator's key. + +resource = get_site_map(app_url, login_url, secret_key) print "Serving..." -deploy( - MapResource({ - "simple" : - LoginRedirectResource( - login_url="http://localhost:8080/login", - app_url="http://localhost:8080", - resource=SimpleResource(), - authenticator=LoginRedirectAuthenticator(secret_key="horses"), - anonymous_parameter_name="anonymous", - logout_parameter_name="logout" - ), - "login" : - LoginResource( - LoginAuthenticator( - secret_key="horses", - credentials=( - ("badger", "abc"), - ("vole", "xyz"), - ) - ) - ) - }), - handle_errors=0 -) +deploy(resource, handle_errors=0) # vim: tabstop=4 expandtab shiftwidth=4 diff -r 8c54afdd38ce -r c74377ab32be examples/BaseHTTPRequestHandler/SimpleWithOpenIDApp.py --- a/examples/BaseHTTPRequestHandler/SimpleWithOpenIDApp.py Sat May 24 15:21:53 2008 +0000 +++ b/examples/BaseHTTPRequestHandler/SimpleWithOpenIDApp.py Sun Aug 24 20:51:10 2008 +0200 @@ -4,10 +4,9 @@ from SimpleWithOpenID import get_site_map app_url = "http://localhost:8080" # No trailing "/"! -initiation_url = "http://localhost:8080/login" secret_key = "horses" # Must match the login authenticator's key. -resource = get_site_map(app_url, initiation_url, secret_key) +resource = get_site_map(app_url, app_url + "/login", secret_key) print "Serving..." deploy(resource, handle_errors=0) diff -r 8c54afdd38ce -r c74377ab32be examples/CGI/SimpleWithLoginHandler.py --- a/examples/CGI/SimpleWithLoginHandler.py Sat May 24 15:21:53 2008 +0000 +++ b/examples/CGI/SimpleWithLoginHandler.py Sun Aug 24 20:51:10 2008 +0200 @@ -8,38 +8,24 @@ #sys.path.append("/home/paulb/Software/Python/WebStack/examples/Common") from WebStack.Adapters.CGI import deploy -from WebStack.Resources.LoginRedirect import LoginRedirectResource, LoginRedirectAuthenticator -from WebStack.Resources.Login import LoginResource, LoginAuthenticator -from WebStack.Resources.ResourceMap import MapResource -from Simple import SimpleResource +from SimpleWithLogin import get_site_map + +# Change this to be the exact URL. +# eg. http://localhost:8000/cgi/myapp/requestid + +login_url = "http://localhost/cgi/simplewithlogin/login" + +# Change this to be the URL base for your server. +# eg. http://localhost:8000 -deploy( - MapResource({ - "simple" : - LoginRedirectResource( - login_url="http://localhost/cgi/login", # Change this to be the exact URL on your server. - # eg. http://localhost:8000/cgi/LoginHandler.py - app_url="http://localhost", # Change this to be the URL base for your server. - # eg. http://localhost:8000 - # Note that the login application can be placed on - # a different server if desirable. - resource=SimpleResource(), - authenticator=LoginRedirectAuthenticator(secret_key="horses"), - anonymous_parameter_name="anonymous", - logout_parameter_name="logout" - ), - "login" : - LoginResource( - LoginAuthenticator( - secret_key="horses", - credentials=( - ("badger", "abc"), - ("vole", "xyz"), - ) - ) - ) - }), - handle_errors=0 -) +app_url = "http://localhost" # No trailing "/"! + +# Must match the key used elsewhere. + +secret_key = "horses" + +resource = get_site_map(app_url, login_url, secret_key) + +deploy(resource, handle_errors=0) # vim: tabstop=4 expandtab shiftwidth=4 diff -r 8c54afdd38ce -r c74377ab32be examples/Common/DemoApp.py --- a/examples/Common/DemoApp.py Sat May 24 15:21:53 2008 +0000 +++ b/examples/Common/DemoApp.py Sun Aug 24 20:51:10 2008 +0200 @@ -7,8 +7,6 @@ # Import the things which make the resource work. from WebStack.Resources.ResourceMap import MapResource -from WebStack.Resources.LoginRedirect import LoginRedirectResource, LoginRedirectAuthenticator -from WebStack.Resources.Login import LoginResource, LoginAuthenticator # Here are all the test resources. @@ -16,6 +14,8 @@ from Form import FormResource from Sessions import SessionsResource from Simple import SimpleResource +from SimpleWithLogin import get_site_map as SimpleWithLoginResource +from SimpleWithOpenID import get_site_map as SimpleWithOpenIDResource from Unicode import UnicodeResource from VerySimple import VerySimpleResource from Calendar import CalendarResource @@ -41,6 +41,7 @@
  • Session information
  • Simple test
  • Simple with login test
  • +
  • Simple with OpenID test
  • Unicode test
  • Very simple test
  • Calendar store example - requires a WebDAV-capable browser
    @@ -54,7 +55,7 @@ """) trans.set_response_code(200) -def get_site(): +def get_site(app_url, secret_key): "Define the resource mapping." @@ -63,25 +64,8 @@ "form" : FormResource(), "sessions" : SessionsResource(), "simple" : SimpleResource(), - "simplewithlogin" : - LoginRedirectResource( - login_url="http://localhost:8080/login", - app_url="http://localhost:8080", - resource=SimpleResource(), - authenticator=LoginRedirectAuthenticator(secret_key="horses"), - anonymous_parameter_name="anonymous", - logout_parameter_name="logout" - ), - "login" : - LoginResource( - LoginAuthenticator( - secret_key="horses", - credentials=( - ("badger", "abc"), - ("vole", "xyz"), - ) - ) - ), + "simplewithlogin" : SimpleWithLoginResource(app_url, app_url + "/simplewithlogin/login", secret_key), + "simplewithopenid" : SimpleWithOpenIDResource(app_url, app_url + "/simplewithopenid/login", secret_key), "unicode" : UnicodeResource(), "verysimple" : VerySimpleResource(), "calendar" : CalendarResource(), diff -r 8c54afdd38ce -r c74377ab32be examples/Common/SimpleWithOpenID/__init__.py --- a/examples/Common/SimpleWithOpenID/__init__.py Sat May 24 15:21:53 2008 +0000 +++ b/examples/Common/SimpleWithOpenID/__init__.py Sun Aug 24 20:51:10 2008 +0200 @@ -10,9 +10,8 @@ def get_site_map(app_url, initiation_url, secret_key): """ - Resource a resource for the site having the given 'app_url', using the given - 'initiation_url' for the OpenID initiation page, and the specified - 'secret_key' for authentication tokens. + Resource a resource for the site having the given 'app_url' and + 'initiation_url', using the given 'secret_key' for authentication tokens. """ return MapResource({ diff -r 8c54afdd38ce -r c74377ab32be examples/Django/simplewithloginapp.py --- a/examples/Django/simplewithloginapp.py Sat May 24 15:21:53 2008 +0000 +++ b/examples/Django/simplewithloginapp.py Sun Aug 24 20:51:10 2008 +0200 @@ -1,18 +1,23 @@ #!/usr/bin/env python from WebStack.Adapters.Django import deploy -from WebStack.Resources.LoginRedirect import LoginRedirectResource, LoginRedirectAuthenticator -from Simple import SimpleResource +from SimpleWithLogin import get_site_map + +# Change this to be the exact URL. +# eg. http://localhost:8000/django/myapp/login + +login_url="http://localhost:8080/django/webstack/login" -resource = LoginRedirectResource( - login_url="http://localhost:8080/django/webstack/login", - app_url="http://localhost:8080", - resource=SimpleResource(), - authenticator=LoginRedirectAuthenticator(secret_key="horses"), - anonymous_parameter_name="anonymous", - logout_parameter_name="logout", - use_logout_redirect=0 -) +# Change this to be the URL base for your server. +# eg. http://localhost:8000 + +app_url = "http://localhost:8080" # No trailing "/"! + +# Must match the key used elsewhere. + +secret_key = "horses" # Must match the login authenticator's key. + +resource = get_site_map(app_url, login_url, secret_key) simplewithlogin = deploy(resource, handle_errors=0) diff -r 8c54afdd38ce -r c74377ab32be examples/JavaServlet/SimpleWithLoginApp.py --- a/examples/JavaServlet/SimpleWithLoginApp.py Sat May 24 15:21:53 2008 +0000 +++ b/examples/JavaServlet/SimpleWithLoginApp.py Sun Aug 24 20:51:10 2008 +0200 @@ -1,36 +1,26 @@ #!/usr/bin/env python from WebStack.Adapters.JavaServlet import deploy -from WebStack.Resources.LoginRedirect import LoginRedirectResource, LoginRedirectAuthenticator -from WebStack.Resources.Login import LoginResource, LoginAuthenticator -from WebStack.Resources.ResourceMap import MapResource -from Simple import SimpleResource +from SimpleWithLogin import get_site_map + +# Change this to be the exact URL. +# eg. http://localhost:8000/cgi/myapp/requestid + +login_url = "http://localhost:8080/SimpleWithLoginApp/login" + +# Change this to be the URL base for your server. +# eg. http://localhost:8000 + +app_url = "http://localhost:8080" # No trailing "/"! + +# Must match the key used elsewhere. + +secret_key = "horses" + +resource = get_site_map(app_url, login_url, secret_key) # NOTE: Not sure if the resource should be maintained in a resource pool. -SimpleWithLoginApp = deploy( - MapResource({ - "simple" : - LoginRedirectResource( - login_url="http://localhost:8080/SimpleWithLoginApp/login", - app_url="http://localhost:8080", - resource=SimpleResource(), - authenticator=LoginRedirectAuthenticator(secret_key="horses"), - anonymous_parameter_name="anonymous", - logout_parameter_name="logout" - ), - "login" : - LoginResource( - LoginAuthenticator( - secret_key="horses", - credentials=( - ("badger", "abc"), - ("vole", "xyz"), - ) - ) - ) - }), - handle_errors=0 -) +SimpleWithLoginApp = deploy(resource, handle_errors=0) # vim: tabstop=4 expandtab shiftwidth=4 diff -r 8c54afdd38ce -r c74377ab32be examples/ModPython/SimpleWithLoginApp/SimpleWithLoginHandler.py --- a/examples/ModPython/SimpleWithLoginApp/SimpleWithLoginHandler.py Sat May 24 15:21:53 2008 +0000 +++ b/examples/ModPython/SimpleWithLoginApp/SimpleWithLoginHandler.py Sun Aug 24 20:51:10 2008 +0200 @@ -6,21 +6,26 @@ sys.path.append(os.path.abspath(os.path.join(__file__, "../../../Common"))) from WebStack.Adapters.ModPython import deploy -from WebStack.Resources.LoginRedirect import LoginRedirectResource, LoginRedirectAuthenticator -from Simple import SimpleResource +from SimpleWithLogin import get_site_map + +# Change this to be the exact URL. +# eg. http://localhost:8000/myapp/login + +login_url = "http://localhost/login/app" + +# Change this to be the URL base for your server. +# eg. http://localhost:8000 + +app_url = "http://localhost" # No trailing "/"! + +# Must match the key used elsewhere. + +secret_key = "horses" + +resource = get_site_map(app_url, login_url, secret_key) # NOTE: Not sure if the resource should be maintained in a resource pool. -resource = LoginRedirectResource( - login_url="http://localhost/login/app", - app_url="http://localhost", - resource=SimpleResource(), - authenticator=LoginRedirectAuthenticator(secret_key="horses"), - anonymous_parameter_name="anonymous", - logout_parameter_name="logout", - use_logout_redirect=0 -) - handler, _no_authentication = deploy(resource, handle_errors=0) # vim: tabstop=4 expandtab shiftwidth=4 diff -r 8c54afdd38ce -r c74377ab32be examples/Twisted/SimpleWithLoginApp.py --- a/examples/Twisted/SimpleWithLoginApp.py Sat May 24 15:21:53 2008 +0000 +++ b/examples/Twisted/SimpleWithLoginApp.py Sun Aug 24 20:51:10 2008 +0200 @@ -1,35 +1,25 @@ #!/usr/bin/env python from WebStack.Adapters.Twisted import deploy -from WebStack.Resources.LoginRedirect import LoginRedirectResource, LoginRedirectAuthenticator -from WebStack.Resources.Login import LoginResource, LoginAuthenticator -from WebStack.Resources.ResourceMap import MapResource -from Simple import SimpleResource +from SimpleWithLogin import get_site_map + +# Change this to be the exact URL. +# eg. http://localhost:8000/myapp/login + +login_url = "http://localhost:8080/login" + +# Change this to be the URL base for your server. +# eg. http://localhost:8000 + +app_url = "http://localhost:8080" # No trailing "/"! + +# Must match the key used elsewhere. + +secret_key = "horses" + +resource = get_site_map(app_url, login_url, secret_key) print "Serving..." -deploy( - MapResource({ - "simple" : - LoginRedirectResource( - login_url="http://localhost:8080/login", - app_url="http://localhost:8080", - resource=SimpleResource(), - authenticator=LoginRedirectAuthenticator(secret_key="horses"), - anonymous_parameter_name="anonymous", - logout_parameter_name="logout" - ), - "login" : - LoginResource( - LoginAuthenticator( - secret_key="horses", - credentials=( - ("badger", "abc"), - ("vole", "xyz"), - ) - ) - ) - }), - handle_errors=0 -) +deploy(resource, handle_errors=0) # vim: tabstop=4 expandtab shiftwidth=4 diff -r 8c54afdd38ce -r c74377ab32be examples/WSGI/SimpleWithLoginApp.py --- a/examples/WSGI/SimpleWithLoginApp.py Sat May 24 15:21:53 2008 +0000 +++ b/examples/WSGI/SimpleWithLoginApp.py Sun Aug 24 20:51:10 2008 +0200 @@ -8,34 +8,24 @@ #sys.path.append("/home/paulb/Software/Python/WebStack/examples/Common") from WebStack.Adapters.WSGI import deploy_with_wsgiref as deploy -from WebStack.Resources.LoginRedirect import LoginRedirectResource, LoginRedirectAuthenticator -from WebStack.Resources.Login import LoginResource, LoginAuthenticator -from WebStack.Resources.ResourceMap import MapResource -from Simple import SimpleResource +from SimpleWithLogin import get_site_map + +# Change this to be the exact URL. +# eg. http://localhost:8000/myapp/login + +login_url = "http://localhost:8080/login" + +# Change this to be the URL base for your server. +# eg. http://localhost:8000 -deploy( - MapResource({ - "simple" : - LoginRedirectResource( - login_url="http://localhost:8080/login", - app_url="http://localhost:8080", - resource=SimpleResource(), - authenticator=LoginRedirectAuthenticator(secret_key="horses"), - anonymous_parameter_name="anonymous", - logout_parameter_name="logout" - ), - "login" : - LoginResource( - LoginAuthenticator( - secret_key="horses", - credentials=( - ("badger", "abc"), - ("vole", "xyz"), - ) - ) - ) - }), - handle_errors=0 -) +app_url = "http://localhost:8080" # No trailing "/"! + +# Must match the key used elsewhere. + +secret_key = "horses" + +resource = get_site_map(app_url, login_url, secret_key) + +deploy(resource, handle_errors=0) # vim: tabstop=4 expandtab shiftwidth=4 diff -r 8c54afdd38ce -r c74377ab32be examples/WSGI/SimpleWithLoginHandler.py --- a/examples/WSGI/SimpleWithLoginHandler.py Sat May 24 15:21:53 2008 +0000 +++ b/examples/WSGI/SimpleWithLoginHandler.py Sun Aug 24 20:51:10 2008 +0200 @@ -8,34 +8,24 @@ #sys.path.append("/home/paulb/Software/Python/WebStack/examples/Common") from WebStack.Adapters.WSGI import deploy_as_cgi -from WebStack.Resources.LoginRedirect import LoginRedirectResource, LoginRedirectAuthenticator -from WebStack.Resources.Login import LoginResource, LoginAuthenticator -from WebStack.Resources.ResourceMap import MapResource from Simple import SimpleResource -deploy_as_cgi( - MapResource({ - "simple" : - LoginRedirectResource( - login_url="http://localhost/wsgi/login", - app_url="http://localhost", - resource=SimpleResource(), - authenticator=LoginRedirectAuthenticator(secret_key="horses"), - anonymous_parameter_name="anonymous", - logout_parameter_name="logout" - ), - "login" : - LoginResource( - LoginAuthenticator( - secret_key="horses", - credentials=( - ("badger", "abc"), - ("vole", "xyz"), - ) - ) - ) - }), - handle_errors=0 -) +# Change this to be the exact URL. +# eg. http://localhost:8000/myapp/login + +login_url = "http://localhost/wsgi/login" + +# Change this to be the URL base for your server. +# eg. http://localhost:8000 + +app_url = "http://localhost" # No trailing "/"! + +# Must match the key used elsewhere. + +secret_key = "horses" + +resource = get_site_map(app_url, login_url, secret_key) + +deploy_as_cgi(resource, handle_errors=0) # vim: tabstop=4 expandtab shiftwidth=4 diff -r 8c54afdd38ce -r c74377ab32be examples/Webware/SimpleWithLoginApp/__init__.py --- a/examples/Webware/SimpleWithLoginApp/__init__.py Sat May 24 15:21:53 2008 +0000 +++ b/examples/Webware/SimpleWithLoginApp/__init__.py Sun Aug 24 20:51:10 2008 +0200 @@ -4,38 +4,29 @@ Webware plug-in code. """ -__version__ = "0.1" +__version__ = "1.3" from WebStack.Adapters.Webware import WebStackServletFactory -from WebStack.Resources.LoginRedirect import LoginRedirectResource, LoginRedirectAuthenticator -from WebStack.Resources.Login import LoginResource, LoginAuthenticator -from WebStack.Resources.ResourceMap import MapResource -from Simple import SimpleResource +from SimpleWithLogin import get_site_map + +# Change this to be the exact URL. +# eg. http://localhost:8000/myapp/login + +login_url = "http://localhost/webkit/app.login" + +# Change this to be the URL base for your server. +# eg. http://localhost:8000 + +app_url = "http://localhost" # No trailing "/"! + +# Must match the key used elsewhere. + +secret_key = "horses" + +resource = get_site_map(app_url, login_url, secret_key) # NOTE: Initialising a shared resource. -resource = MapResource({ - "simple" : - LoginRedirectResource( - login_url="http://localhost/webkit/app.login", - app_url="http://localhost", - resource=SimpleResource(), - authenticator=LoginRedirectAuthenticator(secret_key="horses"), - anonymous_parameter_name="anonymous", - logout_parameter_name="logout" - ), - "login" : - LoginResource( - LoginAuthenticator( - secret_key="horses", - credentials=( - ("badger", "abc"), - ("vole", "xyz"), - ) - ) - ) - }) - def InstallInWebKit(appServer): global resource app = appServer.application() diff -r 8c54afdd38ce -r c74377ab32be examples/Webware/SimpleWithLoginContext/__init__.py --- a/examples/Webware/SimpleWithLoginContext/__init__.py Sat May 24 15:21:53 2008 +0000 +++ b/examples/Webware/SimpleWithLoginContext/__init__.py Sun Aug 24 20:51:10 2008 +0200 @@ -1,39 +1,30 @@ #!/usr/bin/env python """ -Webware context for the Simple application (post Webware 0.8.1). +Webware context for the SimpleWithLogin application (post Webware 0.8.1). """ from WebStack.Adapters.Webware import deploy -from WebStack.Resources.LoginRedirect import LoginRedirectResource, LoginRedirectAuthenticator -from WebStack.Resources.Login import LoginResource, LoginAuthenticator -from WebStack.Resources.ResourceMap import MapResource -from Simple import SimpleResource +from SimpleWithLogin import get_site_map + +# Change this to be the exact URL. +# eg. http://localhost:8000/myapp/login + +login_url = "http://localhost:9080/simplewithlogin/login" + +# Change this to be the URL base for your server. +# eg. http://localhost:8000 + +app_url = "http://localhost:9080" # No trailing "/"! + +# Must match the key used elsewhere. + +secret_key = "horses" + +resource = get_site_map(app_url, login_url, secret_key) # NOTE: Initialising a shared resource. -resource = MapResource({ - "simple" : - LoginRedirectResource( - login_url="http://localhost:9080/simplewithlogin/login", - app_url="http://localhost:9080", - resource=SimpleResource(), - authenticator=LoginRedirectAuthenticator(secret_key="horses"), - anonymous_parameter_name="anonymous", - logout_parameter_name="logout" - ), - "login" : - LoginResource( - LoginAuthenticator( - secret_key="horses", - credentials=( - ("badger", "abc"), - ("vole", "xyz"), - ) - ) - ) - }) - urlParser = deploy(resource, handle_errors=0) # vim: tabstop=4 expandtab shiftwidth=4 diff -r 8c54afdd38ce -r c74377ab32be examples/Zope/SimpleWithLoginProduct/__init__.py --- a/examples/Zope/SimpleWithLoginProduct/__init__.py Sat May 24 15:21:53 2008 +0000 +++ b/examples/Zope/SimpleWithLoginProduct/__init__.py Sun Aug 24 20:51:10 2008 +0200 @@ -9,38 +9,23 @@ from WebStack.Adapters.Zope import WebStackAdapterProduct from Globals import InitializeClass -# NOTE: Make sure this URL matches your Zope configuration. +# Change this to be the URL base for your server. +# eg. http://localhost:8000 -server_url = "http://localhost:9080" +app_url = "http://localhost" # No trailing "/"! + +# Must match the key used elsewhere. + +secret_key = "horses" class SimpleWithLoginProduct(WebStackAdapterProduct): meta_type = "Simple with login product" def __init__(self, id, parent_url): - WebStackAdapterProduct.__init__(self, id, - MapResource({ - "simple" : - LoginRedirectResource( - login_url=parent_url + "/" + id + "/login", - app_url=server_url, - resource=SimpleResource(), - authenticator=LoginRedirectAuthenticator(secret_key="horses"), - anonymous_parameter_name="anonymous", - logout_parameter_name="logout" - ), - "login" : - LoginResource( - LoginAuthenticator( - secret_key="horses", - credentials=( - ("badger", "abc"), - ("vole", "xyz"), - ) - ) - ) - }) - ) + login_url = parent_url + "/" + id + "/login" + resource = get_site_map(app_url, login_url, secret_key) + WebStackAdapterProduct.__init__(self, id, resource) InitializeClass(SimpleWithLoginProduct) diff -r 8c54afdd38ce -r c74377ab32be tools/demo.py --- a/tools/demo.py Sat May 24 15:21:53 2008 +0000 +++ b/tools/demo.py Sun Aug 24 20:51:10 2008 +0200 @@ -4,6 +4,11 @@ import os, sys +# Configuration. + +app_url = "http://localhost:8080" # No trailing "/"! +secret_key = "horses" + # Find out where WebStack's distribution directory is. program = sys.argv[0] @@ -19,7 +24,7 @@ sys.path.append(os.path.join(base, "examples", "Common")) import DemoApp -resource = DemoApp.get_site() +resource = DemoApp.get_site(app_url, secret_key) # Try and open the application in a Web browser. # The preferred module is Paul's desktop module: @@ -33,7 +38,7 @@ except ImportError: import webbrowser as desktop - desktop.open("http://localhost:8080") + desktop.open(app_url) # Special magic incantation to start the demo.