I'm trying to use arguments from the console to use the --auth_local_webserver, --auth_host_port, this ones are required to get credentials from OAUTH2, but I can't make it work
I'm using the console this way python google\dev_appserver.py --auth_local_webserver=localhost --auth_host_port project/
My directory is this Project/app.main Project/Handlers/VideoTesting
And the VideoTesting is the one I'm using for handle the gflags, I really don't understand much of this and I have read a lot,
if FLAGS.auth_local_webserver:
success = False
port_number = 0
for port in FLAGS.auth_host_port:
port_number = port
debug.response.write(str(port_number))
try:
httpd = ClientRedirectServer((FLAGS.auth_host_name, port),
ClientRedirectHandler)
debug.response.write('what')
except socket.error, e:
pass
else:
success = True
break
FLAGS.auth_local_webserver = success
if FLAGS.auth_local_webserver:
oauth_callback = 'http://%s:%s/' % (FLAGS.auth_host_name, port_number)
else:
oauth_callback = 'oob'
authorize_url = flow.step1_get_authorize_url(oauth_callback)
FLAGS = gflags.FLAGS
gflags.DEFINE_boolean('auth_local_webserver', True,
('Run a local web server to handle redirects during '
'OAuth authorization.'))
gflags.DEFINE_string('auth_host_name', 'localhost',
('Host name to use when running a local web server to '
'handle redirects during OAuth authorization.'))
gflags.DEFINE_multi_int('auth_host_port', [8080, 8090],
('Port to use when running a local web server to '
'handle redirects during OAuth authorization.'))