å
æ¥ãã¦ã§ããã¼ã¸ãå
¬éããæ©ä¼ããã£ãã
å©ç¨ãããã¹ãã£ã³ã°ãµã¼ãã¹ã¯ãç¡æã§ãå©ç¨ã§ããã
以ä¸ã®ï¼ã¤ã§æ¤è¨ããã
- Google Drive
- 以åã«ä½¿ã£ããã¨ãããã®ã§ãã¨ã¦ãç°¡åã«ã§ãããã¨ã¯ç¥ã£ã¦ãã
- URLãæ ¼å¥½æªããªã£ã¦ãã¾ãã®ãæ®å¿µ
- Google App Engine
- URLã¯ã·ã³ãã«ã§è¯ã
ä»åã¯åå¼·ãå ¼ãã¦ãGoogle App Engineã使ç¨ãã¦ã¿ããã¨ã«ããã å®éã«è¡ã£ããã¨ãæãåºããªãããæºåããã¦ã§ããã¼ã¸ã®å ¬éã¾ã§ãã¾ã¨ããã
æºåï¼
ã¾ãã¯ãGoogle Cloud Platformã®è¨å®ããå§ãã
ãããããã¼ã³ã³ã½ã¼ã«ã«ã¢ã¯ã»ã¹
- ååã¯Google Cloud Platformã®ç»é²ä½æ¥ãããããèªå°ã«å¾ã£ã¦ããã°å¤§ä¸å¤«ã ã£ãï¼ååç»é²ã¯ãã§ã«çµãããã¦ããããä»åã¯è¡ã£ã¦ããªãï¼
ãããã¸ã§ã¯ããç»é¢ã®ãããã¸ã§ã¯ããä½æããã¯ãªãã¯
以ä¸ã®ãããªããã«ã表示ããã
ããã¸ã§ã¯ãå
ã«ã¯é©å½ã«ããã¸ã§ã¯ãã®ååãå ¥åï¼å¾ãããå¤æ´å¯è½ãããï¼ãããã§æ±ºããååã¯ã³ã³ã½ã¼ã«ã§ä½¿ç¨ãããã ãããã¸ã§ã¯ãID
ã¯å¾ããå¤æ´ã§ããªãã®ã§æ éã«æ±ºããã»ããè¯ããããã¸ã§ã¯ãï¼ã¢ããªï¼ã®URLã¯ã
ããã¸ã§ã¯ãID
.appspot.com
ã¨ãªããï¼å¾ã§ä½¿ãã®ã§å¿ããªãããã«ã©ããã«æ§ãã¦ããï¼
以ä¸ã§ã³ã³ã½ã¼ã«å´ã®æºåã¯çµäºã
æºåï¼
ç¶ãã¦PCå´ã®æºåãè¡ããããããã¯Windowsåãã®å
容ã¨ãªã£ã¦ããã
GAEã«ã¯PythonãJavaãPHPãGoãã¼ã¸ã§ã³ãç¨æããã¦ããããä»åã¯Pythonçã使ããã¨ã«ãããï¼ä»åã®ç®çã¯htmlãjsããã¹ãããã ããªã®ã§pythonã¯ä½¿ããªãã...ï¼
ã¤ã³ã¹ãã¼ã«ãããã®ã¯ï¼ã¤ãããé常ã®ã¢ããªã¨åæ§ã«ãã¦ã³ãã¼ãã»ã¤ã³ã¹ãã¼ã«ããã°è¯ãã
Python 2.7.x
- ãã¡ãã®ãã¼ã¸ããå
¥æã§ããããWindows X86-64 MSI Installer (2.7.6)ãããã¦ã³ãã¼ããããã¤ã³ã¹ãã¼ã©ããã¦ã³ãã¼ãããããããã«ã¯ãªãã¯ã§ã¤ã³ã¹ãã¼ã«ãéå§ãããéä¸ã§Pythonã®ã¤ã³ã¹ãã¼ã«å
ãèãããã®ã§ãä»»æã®å ´æãæå®ããããããæ§ãã¦ããã¨è¯ããç§ã¯
C:\Python27\
ã¨ããã - (注æï¼Pythonã«ã¯
3.x.x
ã®ãã¼ã¸ã§ã³ãããããGAEã®é½åä¸ãå¿ ã2.7.x
ã®ãã®ãå ¥æãããã¨ã
- ãã¡ãã®ãã¼ã¸ããå
¥æã§ããããWindows X86-64 MSI Installer (2.7.6)ãããã¦ã³ãã¼ããããã¤ã³ã¹ãã¼ã©ããã¦ã³ãã¼ãããããããã«ã¯ãªãã¯ã§ã¤ã³ã¹ãã¼ã«ãéå§ãããéä¸ã§Pythonã®ã¤ã³ã¹ãã¼ã«å
ãèãããã®ã§ãä»»æã®å ´æãæå®ããããããæ§ãã¦ããã¨è¯ããç§ã¯
Google App Engine SDK for Python
- ãã¡ãã®ãã¼ã¸ããå
¥æã§ããããGoogle App Engine SDK for Pythonãã®é
ç®ãããGoogleAppEngine-1.9.2.msiãããã¦ã³ãã¼ããããã¤ã³ã¹ãã¼ã©ããã¦ã³ãã¼ãããããããã«ã¯ãªãã¯ã§ã¤ã³ã¹ãã¼ã«ãéå§ããããã¡ããéä¸ã§ã¤ã³ã¹ãã¼ã«å
ãèãããã®ã§ãä»»æã®å ´æãæå®ãããç§ã¯
C:\Program Files (x86)\Google\google_appengine\
ã¨ããã
- ãã¡ãã®ãã¼ã¸ããå
¥æã§ããããGoogle App Engine SDK for Pythonãã®é
ç®ãããGoogleAppEngine-1.9.2.msiãããã¦ã³ãã¼ããããã¤ã³ã¹ãã¼ã©ããã¦ã³ãã¼ãããããããã«ã¯ãªãã¯ã§ã¤ã³ã¹ãã¼ã«ãéå§ããããã¡ããéä¸ã§ã¤ã³ã¹ãã¼ã«å
ãèãããã®ã§ãä»»æã®å ´æãæå®ãããç§ã¯
以ä¸ã§ã¤ã³ã¹ãã¼ã«ä½æ¥ã¯çµäºã
è¨å®
ã¹ãã³ãµã¼ãªã³ã¯
PCå´ã§å種è¨å®ãè¡ãã
ç°å¢å¤æ°
PATH
ã«Pythonã®ãã¹ï¼ç§ã®å ´åã¯;C:\Python27\
ï¼ã追å ãã
Google App Engine Launcher
ãã¹ã¯ãããã«ã¤ããããã¢ã¤ã³ã³ãããã«ã¯ãªãã¯ãã¦Google App Engine Launcherãéã
ãEditãã¡ãã¥ã¼ã®ãPreferences...ããã¯ãªãã¯
- ãPython Pathãã®æ¬ã«Pythonã®ãã¹ï¼
C:\Python27\python.exe
ï¼ãå ¥åããOKããã¯ãªãã¯
- ãPython Pathãã®æ¬ã«Pythonã®ãã¹ï¼
ãããã¤ã¾ã§
- Google App Engine Launcherã®ã¦ã£ã³ãã¦ã®å³ä¸ã®ãï¼ããã¿ã³ãã¯ãªãã¯
- 以ä¸ã®ãããªè¨å®ã¦ã£ã³ãã¦ãéã
- ãApplication Nameãã¨ãParent Directoryããæå®ãããä¾ãã°ããApplication Nameãã«
engineapp
ããParent Directoryãã«C:\gae\
ãæå®ããã¨C:\gae\engineapp
å ã«åç¨®å¿ è¦ãªãã¡ã¤ã«ãèªåçæããã - ä»ã®é ç®ã«ã¤ãã¦ã¯ä¸ã®ç»åã®ããã«ãªã£ã¦ããã°è¯ã
- ãcreateããã¯ãªãã¯ãã¦è¨å®ã¦ã£ã³ãã¦ãéãã
- ãApplication Nameãã¨ãParent Directoryããæå®ãããä¾ãã°ããApplication Nameãã«
次ã«ãå ã»ã©æå®ãããã¹ï¼ä¾ã§ã¯
C:\gae\engineapp
ï¼å ã«public
çã®ååãä»ãããã©ã«ãã¼ãä½ãããã®ä¸ã«å ¬éãããã¦ã§ããã¼ã¸ãæ§æãããã¡ã¤ã«ï¼htmlãjavascriptãcssãªã©ï¼ãå ¥ãã¦ãããä»åã¯ä¾ã¨ãã¦index.html
ã®ã¿ãå ¥ãã¦ããããç¶ãã¦ãGoogle App Engine Launcherã®ã¦ã£ã³ãã¦ã§å ã»ã©ã®ãApplication Nameãã®é ç®ãã¯ãªãã¯
- ã¦ã£ã³ãã¦ä¸é¨ã®ãEdit]ãã¿ã³ãã¯ãªãã¯
app.yaml
ã¨ãããã¡ã¤ã«ãéãã®ã§ãããç·¨éããããã®ãã¡ã¤ã«ã¯è¨å®æã«æå®ãããã¹ï¼ä¾ã§ã¯C:\gae\engineapp
ï¼å ã«å ¥ã£ã¦ããã- 該å½ããç®æã以ä¸ã®ããã«å¤æ´ãã
handlers: - url: / static_files: public/index.html upload: / - url: / static_dir: public
- ããã¾ã§çµããããã¦ã£ã³ãã¦ä¸é¨ã®ãDeployããã¿ã³ãã¯ãªãã¯
- ãããããã¼ã³ã³ã½ã¼ã«ã«ç»é²ããGoogleã¢ã«ã¦ã³ãã®ãEmailãã¨ãPasswordããå ¥åãã¦ãOKããã¯ãªãã¯
- é²æã示ãç»é¢ãéãããããã¤ä½æ¥ãè¡ãããã®ã§å¾ ã¤ãã¨ã©ã¼ãåºãã«ããYou can close this window nowãã表示ããããã¨ã確èªãã¦çµäºã
ã¦ã§ãã§ç¢ºèª
- ãã©ã¦ã¶ãéãã
ããã¸ã§ã¯ãID
.appspot.com ã«ã¢ã¯ã»ã¹ããæ£ãããã¼ã¸*3ã表示ããã¦ãããã¨ã確èªããã
追è¨
ãã¼ã«ã«ã§ç¢ºèªããæ¹æ³
å®éã«ãããã¤ããåã«ãã¼ã«ã«ã§ç¢ºèªãããã¨ãã§ããã
- Google App Engine Launcherã®ã¦ã£ã³ãã¦ä¸é¨ã®ãRunããã¯ãªãã¯
- ãã¼ã«ã«ã§ã®å®è¡ãçµäºããå ´åã¯é£ã®ãStopããã¯ãªãã¯
- ãlocalhost:
ãã¼ãçªå·
ãã«ã¢ã¯ã»ã¹
Google App Engine Launcher ã®ã¢ãããã¼ã
Google App Engine Launcherã®æ°ãã¼ã¸ã§ã³ãç»å ´ããã¨ãã¯ãå¿
ãæ´æ°ããã»ããè¯ãããã§ãã
ï¼æ°ãã¼ã¸ã§ã³ã®åå¨ãç¥ããã«ãããã¤ããããã¨æã£ããã§ãã¾ããã§ãããï¼
æ´æ°æã«æ³¨æãããã¨ãã¾ã¨ãã¦ã¿ã¾ãã
- ä¸ä¸ã®ãã¨ã«åãã¦ãããã¸ã§ã¯ãã®ãã¡ã¤ã«ã®ããã¯ã¢ãããåããï¼ç§ã®å ´åã¯æ°ãã¼ã¸ã§ã³ã®ã¤ã³ã¹ãã¼ã«æã«èªåã§å¼ãç¶ããã¾ãããã念ã®ãããï¼
- ã¤ã³ã¹ãã¼ã«ããã¦ããGoogle App Engine Launcherã®å¤ããã¼ã¸ã§ã³ãã¢ã³ã¤ã³ã¹ãã¼ã«ããããããã¢ã³ã¤ã³ã¹ãã¼ã«ããªãã¨ãæ°ãã¼ã¸ã§ã³ãã¤ã³ã¹ãã¼ã«ã§ãã¾ããã§ããã
- ãã¡ãããææ°çããã¦ã³ãã¼ããã¦ãã¤ã³ã¹ãã¼ã«ããã