我应该在开发服务器上为Google App Engine BulkLoader添加哪些凭据? [英] Which credentials should I put in for Google App Engine BulkLoader at development server?

查看:88
本文介绍了我应该在开发服务器上为Google App Engine BulkLoader添加哪些凭据?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想问一下我需要使用Google App Engine BulkLoader类导入数据时使用哪种凭证

  appcfg.py upload_data --config_file = models.py --filename = listcountries.csv --kind = CMSCountry --url = http:// localhost:8178 / remote_api vit / 



然后它向我要求凭证:


请输入
localhost的登录凭证

这里是对models.py内容的提取,我用这个 listcountries.csv file

  class CMSCountry(db.Model):
sortorder = db.StringProperty()
name = db.StringProperty(required = True)
formalname = db.StringProperty()
type = db.StringProperty()
subtype = db.StringProperty()
sovereignt = db.StringProperty()
capital = db.StringProperty()
curr encycode = db.StringProperty()
currencyname = db.StringProperty()
telephonecode = db.StringProperty()
lettercode = db.StringProperty()
lettercode2 = db.StringProperty )
number = db.StringProperty()
countrycode = db.StringProperty()
$ b $ class CMSCountryLoader(bulkloader.Loader):
def __init __(self):
bulkloader.Loader .__ init __(self,'CMSCountry',
[('sortorder',str),
('name',str),
('formalname',str ),
('type',str),
('subtype',str),
('sovereignt',str),
('capital',str),
('currencycode',str),
('currencyname',str),
('telephonecode',str),
('lettercode',str),
('lettercode2',str),
('number',str),
('countrycode',str)
])$每个尝试输入电子邮件和密码的结果都是身份验证失败,所以我无法将数据导入到开发服务器。



我不认为我的文件与我的模型没有任何问题,因为我已成功将数据上传到appspot.com应用程序。

那么我应该为本地主机凭证输入什么?

我也尝试过使用 Eclipse与Pydev ,但我仍然得到相同的消息:(

以下是输出结果:

$ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ b [INFO]打开数据库:bulkloader-progress-20090820.121659.sql3
[INFO] [Thread-1] WorkerThread:启动
[INFO] [Thread-2] WorkerThread:启动
[INFO ] [线程-3] WorkerThread:启动
[INFO] [Thread-4] WorkerThread:启动
[INFO] [Thread-5] WorkerThread:启动
[INFO] [Thread-6 ] WorkerThread:启动
[INFO] [Thread-7] WorkerThread:启动
[INFO] [Thread-8] WorkerThread:启动
[INFO] [Thread-9] b $ b [信息] [Thread-10] WorkerThread:启动
foobar@nowhere.com的密码:[DEBUG]配置remote_api。 url_path = / remote_api,servername = localhost:8178
$ b [DEBUG]使用app_id的批量加载器:abc
[INFO]连接到/ remote_api
[错误]认证期间出现异常
Traceback(最近的最后一次调用):
文件D:\Projects\GoogleAppEngine\google_appengine\google \appengine\tools\bulkloader.py,行2802,在Run
request_manager.Authenticate()
在Authenticate
remote_api_stub中的文件D:\Projects\GoogleAppEngine\google_appengine\google \appengine\tools\bulkloader.py,第1126行。 MaybeInvokeAuthentication()
在MaybeInvokeAuthentication
datastore_stub中的文件D:\Projects\GoogleAppEngine\google_appengine\google\appengine\ext\remote_api\remote_api_stub.py,第488行。 _server.Send(datastore_stub._path,payload = None)
文件D:\Projects\GoogleAppEngine\google_appengine\google\appengine\tools\\ appengine_rpc.py,第344行,发送
f = self.opener.open(req)
打开$文件C:\Python25\lib\urllib2.py,第381行b $ b response = self._open(req,data)
文件C:\Python25\lib\urllib2.py,第399行,在_open
'_open',req)
在_call_chain
result = func(* args)
文件C:\Python25\lib\urllib2.py,行360,文件C:\Python25\lib \urllib2.py,第1107行,在http_open
中返回self.do_open(httplib.HTTPConnection,req)
文件C:\Python25\lib\urllib2.py,第1082行,在do_open
raise URLError(err)
URLError:< urlopen error(10061,'Connection refused')>
[INFO]身份验证失败

谢谢!

解决方案

我建议您按照这里,我引用:


将其添加到app.yaml文件中:

   -  url:/ loadusers 
脚本:myloader。 py
login:admin

请注意,如果您在本地$ b上运行 $ b开发机器,注销
最后一行登录名:admin,以便您
不需要凭证即可运行
bulkloader


(我强调)。

I would like to ask which kind of credentials do I need to put on for importing data using the Google App Engine BulkLoader class

appcfg.py upload_data --config_file=models.py --filename=listcountries.csv --kind=CMSCountry --url=http://localhost:8178/remote_api vit/

And then it asks me for credentials:

Please enter login credentials for localhost

Here is an extraction of the content of the models.py, I use this listcountries.csv file

class CMSCountry(db.Model):
  sortorder = db.StringProperty()
  name = db.StringProperty(required=True)
  formalname = db.StringProperty()
  type = db.StringProperty()
  subtype = db.StringProperty()
  sovereignt = db.StringProperty()
  capital = db.StringProperty()
  currencycode = db.StringProperty()
  currencyname = db.StringProperty()
  telephonecode = db.StringProperty()
  lettercode = db.StringProperty()
  lettercode2 = db.StringProperty()
  number = db.StringProperty()
  countrycode = db.StringProperty()

class CMSCountryLoader(bulkloader.Loader):
  def __init__(self):
    bulkloader.Loader.__init__(self, 'CMSCountry',
                           [('sortorder', str),
                            ('name', str),
                            ('formalname', str),
                            ('type', str),
                            ('subtype', str),
                            ('sovereignt', str),
                            ('capital', str),
                            ('currencycode', str),
                            ('currencyname', str),
                            ('telephonecode', str),
                            ('lettercode', str),
                            ('lettercode2', str),
                            ('number', str),
                            ('countrycode', str)
                            ])
loaders = [CMSCountryLoader] 

Every tries to enter the email and password result in "Authentication Failed", so I could not import the data to the development server.

I don't think that I have any problem with my files neither my models because I have successfully uploaded the data to the appspot.com application.
So what should I put in for localhost credentials?
I also tried to use Eclipse with Pydev but I still got the same message :(
Here is the output:

Uploading data records.
[INFO    ] Logging to bulkloader-log-20090820.121659
[INFO    ] Opening database: bulkloader-progress-20090820.121659.sql3
[INFO    ] [Thread-1] WorkerThread: started
[INFO    ] [Thread-2] WorkerThread: started
[INFO    ] [Thread-3] WorkerThread: started
[INFO    ] [Thread-4] WorkerThread: started
[INFO    ] [Thread-5] WorkerThread: started
[INFO    ] [Thread-6] WorkerThread: started
[INFO    ] [Thread-7] WorkerThread: started
[INFO    ] [Thread-8] WorkerThread: started
[INFO    ] [Thread-9] WorkerThread: started
[INFO    ] [Thread-10] WorkerThread: started
Password for foobar@nowhere.com: [DEBUG   ] Configuring remote_api. url_path = /remote_api, servername = localhost:8178

[DEBUG   ] Bulkloader using app_id: abc
[INFO    ] Connecting to /remote_api
[ERROR   ] Exception during authentication
Traceback (most recent call last):
  File "D:\Projects\GoogleAppEngine\google_appengine\google\appengine\tools\bulkloader.py", line 2802, in Run
request_manager.Authenticate()
  File "D:\Projects\GoogleAppEngine\google_appengine\google\appengine\tools\bulkloader.py", line 1126, in Authenticate
remote_api_stub.MaybeInvokeAuthentication()
  File "D:\Projects\GoogleAppEngine\google_appengine\google\appengine\ext\remote_api\remote_api_stub.py", line 488, in MaybeInvokeAuthentication
datastore_stub._server.Send(datastore_stub._path, payload=None)
  File "D:\Projects\GoogleAppEngine\google_appengine\google\appengine\tools\appengine_rpc.py", line 344, in Send
f = self.opener.open(req)
  File "C:\Python25\lib\urllib2.py", line 381, in open
response = self._open(req, data)
  File "C:\Python25\lib\urllib2.py", line 399, in _open
'_open', req)
  File "C:\Python25\lib\urllib2.py", line 360, in _call_chain
result = func(*args)
  File "C:\Python25\lib\urllib2.py", line 1107, in http_open
return self.do_open(httplib.HTTPConnection, req)
  File "C:\Python25\lib\urllib2.py", line 1082, in do_open
raise URLError(err)
URLError: <urlopen error (10061, 'Connection refused')>
[INFO    ] Authentication Failed

Thank you!

解决方案

I recommend you follow the advice given here, and I quote:

add this to app.yaml file:

-- url: /loadusers
 script: myloader.py
 login: admin

Note that if you run it on local development machine, comment off the last line login:admin so that you don't need a credential to run the bulkloader.

(my emphasis).

这篇关于我应该在开发服务器上为Google App Engine BulkLoader添加哪些凭据?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆