上星期六參加 Google Developer Day 2008,因為我對 Google Application Engine還滿感興趣的,所以都參加有關GAE的議程,有些收穫,不過還是希望GAE能出Java版﹝就場上回覆的曖昧我想是有機會的﹞。以下是我使用 GAE的一些環境建置步驟,另外我在實機操作時遇到一個問題無法上傳我的應用程式,知道是網路問題可是換了無線網路也是一樣,不過我的NB有另外安裝 Fedora,那個環境就可以傳,所以想說是我作業系統的問題,不過我昨天在家裡試了一下,嘿嘿可以了,可是我已經重灌作業系統,雖然我猜想是Proxy 的問題,因為錯誤訊息好像是死在以下這段
def _GetAuthToken(self, email, password):
"""Uses ClientLogin to authenticate the user, returning an auth token.
Args:
email: The user's email address
password: The user's password
Raises:
ClientLoginError: If there was an error authenticating with ClientLogin.
HTTPError: If there was some other form of HTTP error.
Returns:
The authentication token returned by ClientLogin.
"""
req = self._CreateRequest(
url="https://www.google.com/accounts/ClientLogin",
data=urllib.urlencode({
"Email": email,
"Passwd": password,
"service": "ah",
"source": "Google-appcfg-1.0",
"accountType": "HOSTED_OR_GOOGLE"
})
)
try:
response = self.opener.open(req)
response_body = response.read()
response_dict = dict(x.split("=")
for x in response_body.split("\n") if x)
return response_dict["Auth"]
except urllib2.HTTPError, e:
if e.code == 403:
body = e.read()
response_dict = dict(x.split("=", 1) for x in body.split("\n") if x)
raise ClientLoginError(req.get_full_url(), e.code, e.msg,
e.headers, response_dict)
else:
raise
感覺上還是無法確定就是了
安裝步驟:
1.下載Python
2.安裝Python,給所有人使用或是單一使用者使用,使用Default按下Next
def _GetAuthToken(self, email, password):
"""Uses ClientLogin to authenticate the user, returning an auth token.
Args:
email: The user's email address
password: The user's password
Raises:
ClientLoginError: If there was an error authenticating with ClientLogin.
HTTPError: If there was some other form of HTTP error.
Returns:
The authentication token returned by ClientLogin.
"""
req = self._CreateRequest(
url="https://www.google.com/accounts/ClientLogin",
data=urllib.urlencode({
"Email": email,
"Passwd": password,
"service": "ah",
"source": "Google-appcfg-1.0",
"accountType": "HOSTED_OR_GOOGLE"
})
)
try:
response = self.opener.open(req)
response_body = response.read()
response_dict = dict(x.split("=")
for x in response_body.split("\n") if x)
return response_dict["Auth"]
except urllib2.HTTPError, e:
if e.code == 403:
body = e.read()
response_dict = dict(x.split("=", 1) for x in body.split("\n") if x)
raise ClientLoginError(req.get_full_url(), e.code, e.msg,
e.headers, response_dict)
else:
raise
感覺上還是無法確定就是了
安裝步驟:
1.下載Python
2.安裝Python,給所有人使用或是單一使用者使用,使用Default按下Next
3.Python置放的路徑,使用預設按下Next
4.不用更動直接按下Next則會進行安裝
5.設定環境變數,請將Python的目錄加入Path中
6.測試安裝是否正確
7.下載GAE SDK
8.安裝GAE SDK
9.選擇安裝路徑
10.測試GAE SDK安裝是否完成,至GAE SDK安裝好的目錄
11.執行以下指令
dev_appserver.py demos\guestbook
12.連結到http://localhost:8080/
13.上傳GAE程式
※必要條件:需要有申請GAE通過的帳號
appcfg.py update demos\guestbook
輸入gmail帳號及密碼
登入Google Apps Engine去確認是否上傳成功
大功告成
請問 "設定環境變數,請將Python的目錄加入Path中" 是如何設定的?
回覆刪除我到這邊就看不懂了...
控制台---系統---進階---環境變數中加入就可以
回覆刪除