Connect GAE Remote API to dev_appserver.py
<p>I want to execute a Python script that connects to my local dev_appserver.py instance to run some DataStore queries.</p>

<p>The dev_appserver.py is running with:</p>

<pre><code>builtins:
- remote_api: on
</code></pre>

<p>As per <a href="https://cloud.google.com/appengine/docs/python/tools/remoteapi" rel="nofollow">https://cloud.google.com/appengine/docs/python/tools/remoteapi</a> I have:</p>

<pre><code>remote_api_stub.ConfigureRemoteApiForOAuth(
    hostname,
    '/_ah/remote_api'
)
</code></pre>

<p>In the Python script, but what should the hostname be set to?</p>

<p>For example, when dev_appserver.py started, it prints:</p>

<pre><code>INFO     2016-10-18 12:02:16,850 api_server.py:205] Starting API server at: http://localhost:56700
</code></pre>

<p>But I set the value to localhost:56700, I get the following error:</p>

<pre><code>httplib2.SSLHandshakeError: [SSL: UNKNOWN_PROTOCOL] unknown protocol (_ssl.c:590)
</code></pre>

<p>(Same error for any port that has anything running on it - e.g. 8000, 8080, etc).</p>

<p>If anyone has managed to get this to run successfully, what hostname did you use?</p>

<p>Many thanks,
Ned</p>

<p>The <code>dev_appserver.py</code> doesn't support SSL (I can't find the doc reference anymore), so it can't answer <code>https://</code> requests.</p>

<p>You could try using http-only URLs (not sure if possible with the remote API - I didn't use it yet, may need to disable handler <code>secure</code> option in <code>app.yaml</code> config files). </p>

<p>At least on my devserver I am able to direct my browser to the http-only API server URL reported by <code>devserver.py</code> at startup and I see <code>{app_id: dev~my_app_name, rtok: '0'}</code>.</p>

<p>Or you could setup a proxy server, see <a href="http://stackoverflow.com/questions/8849020/gae-dev-appserver-py-over-https">GAE dev_appserver.py over HTTPS</a>.</p>

python google-app-engine