According to the docs on App Engine, when using the appspot.com domain you have to do some trickery with -dot-
instead of .
in subdomains.
Please note that in April of 2013, Google stopped issuing SSL certificates for double-wildcard domains hosted at appspot.com (i.e. ..appspot.com). If you rely on such URLs for HTTPS access to your application, please change any application logic to use "-dot-" instead of ".". For example, to access version "1" of application "myapp" use "https://1-dot-myapp.appspot.com" instead of "https://1.myapp.appspot.com." If you continue to use "https://1.myapp.appspot.com" the certificate will not match, which will result in an error for any User-Agent that expects the URL and certificate to match exactly.
I am trying to figure out the best way to generate these URLs using the SDK without manually replacing the dots. I've tried modules.get_hostname(module="my module name")
but it returns a traditional sub-domain that triggers the SSL mismatch error.
Edit Per suggestion, I opened a feature request for this functionality
So given for example
you need to replace all but the last two dots with
-dot-
(the last two must remain since the.appspot.com
part much stay untouched).Given this, I'd recommend:
The key ideas:
x.count('.')
tells you how many dots in all stringx
contains; the third optional argument tox.replace
tells Python how many dots, at most, are to be replaced.The
gcloud
command-line utility now hasgcloud app browse
, which will take you to the correct URL. For example, the following commands will launch the URLhttps://1-dot-amodule-dot-myapp.appspot.com
:Or
By default it will attempt opening the URL in a browser, but you can use the
--no-launch-browser
flag to only display the URL.Full docs at https://cloud.google.com/sdk/gcloud/reference/app/browse.