顯示具有 Google App Engine 標籤的文章。 顯示所有文章
顯示具有 Google App Engine 標籤的文章。 顯示所有文章

2014年6月5日 星期四

Eclipse Google AppEngine(Python) 參數




--admin_host=ADMIN_HOST
Host name to which the local Development Console should bind (default: localhost).

--admin_port=ADMIN_PORT
Port to which the local Development Console should bind (default: 8000).

--enable_sendmail
Uses the local computer's Sendmail installation for sending email messages.

--help
Prints a helpful message then quits.

--host=...
The host address to use for the server. You may need to set this to be able to access the development server from another computer on your network. An address of 0.0.0.0 allows both localhost access and hostname access. Default is localhost.

--log_level=...
The lowest logging level at which logging messages will be written to the console; messages of the specified logging level or higher will be output. Possible values are debug, info, warning, error, and critical.

--port=...
The port number to use for the server. Default is 8080. If multiple servers are launched, they will be assigned subsequent ports (e.g. 8081, 8082, etc).

--logs_path=LOGS_FILE
By default, development server logs are stored in memory only. This option turns on disk storage of logs at the location specified by LOGS_FILE, making the logs available across server restarts. For example,devappserver.py --logs_path=/home/logs/boglogs bog


--require_indexes=yes|no
Disables automatic generation of entries in the index.yaml file. Instead, when the application makes a query that requires that its index be defined in the file and the index definition is not found, an exception will be raised, similar to what would happen when running on App Engine. The default value is no.

--smtp_host=...
The hostname of the SMTP server to use for sending email messages.

--smtp_port=...
The port number of the SMTP server to use for sending email messages.

--smtp_user=...
The username to use with the SMTP server for sending email messages.

--smtp_password=...
The password to use with the SMTP server for sending email messages.

--storage_path=...
Path at which all local files (such as the Datastore, Blobstore files, Google Cloud Storage Files, logs, etc) will be stored, unless overridden by --datastore_path, --blobstore_path, --logs_path, etc.



來源:https://developers.google.com/appengine/docs/python/tools/devserver?hl=zh-tw#Python_Command-line_arguments

2013年10月15日 星期二

Gae + Wordpress,eclipse篇!

事前準備,eclipse + PyDev + Gae,還有MySQL都把他搞定,我這裡就不贅述了!

1. 進去建立專案


2. 到Wordpress網站下載最新版本

3. 解壓縮至專案

4.檔案如下圖,app.yamlcron.yamlphp.ini與剛剛解壓縮的wordpress

 5. app.yaml的程式碼如下
application: 你的專案
version: wp
runtime: php
api_version: 1

handlers:
- url: /(.*\.(htm$|html$|css$|js$))
  static_files: wordpress/\1
  upload: wordpress/(.*\.(htm$|html$|css$|js$))
  application_readable: true

- url: /wp-content/(.*\.(ico$|jpg$|png$|gif$))
  static_files: wordpress/wp-content/\1
  upload: wordpress/wp-content/(.*\.(ico$|jpg$|png$|gif$))
  application_readable: true

- url: /(.*\.(ico$|jpg$|png$|gif$))
  static_files: wordpress/\1
  upload: wordpress/(.*\.(ico$|jpg$|png$|gif$))

- url: /wp-admin/(.+)
  script: wordpress/wp-admin/\1
  secure: always

- url: /wp-admin/
  script: wordpress/wp-admin/index.php
  secure: always

- url: /wp-login.php
  script: wordpress/wp-login.php
  secure: always

- url: /wp-cron.php
  script: wordpress/wp-cron.php
  login: admin

- url: /xmlrpc.php
  script: wordpress/xmlrpc.php


- url: /(.+)?/?
  script: wordpress/index.php

6. cron.yaml內容如下
cron:
- description: wordpress cron tasks
  url: /wp-cron.php
  schedule: every 2 hours

 7. php.ini內容如下
google_app_engine.enable_functions = "php_sapi_name, gc_enabled"

 8. 把wordpress底下的wp-config-sample.php的檔名重新命名為wp-config.php

// ** MySQL 設定 - 您可以從主機服務提供商獲取相關資訊。 ** //
/** WordPress 的資料庫名稱,請更改 "database_name_here" */
define('DB_NAME', 'database_name_here');

/** MySQL 資料庫使用者名稱,請更改 "username_here" */
define('DB_USER', 'username_here');

/** MySQL 資料庫密碼,請更改 "password_here" */
define('DB_PASSWORD', 'password_here');

/** MySQL 主機位址 */
if(isset($_SERVER['SERVER_SOFTWARE']) && strpos($_SERVER['SERVER_SOFTWARE'],'Google App Engine') !== false) {
  define('DB_HOST', ':/cloudsql/專案:資料庫(database_name_here)');
}else{
  define('DB_HOST', 'localhost'); //本地端開發用
}

 接下來就好好享受開發ㄉ樂趣吧!


2013年10月1日 星期二

Google App Engine的PHP使用申請加上安裝!!!

本網頁適用於想要在GAE上面開發PHP網頁的開發者觀賞


1.先到AppEngine SDK下載的網站,並點擊使用PHP申請

2.進到連結裡並且按註冊      P.S.要先登入Google 帳號

3.申請成功頁面

4.取得PHP的SDK

5. 選擇您使用的作業系統,像小弟我就是用Windows就選擇Windows。


6.告訴您的作業系統上必須安裝的軟體  
                          P. S.只要安裝最新版本的1.8.5(SDK for Python),就可以了

7.這是在Linux下開發必要的檔案



後記:做到最後,只要已經把PHP使用權申請過後,以後就只要下載SDK for Python的版本就好了。


2013年9月29日 星期日

Google App Engine + Twitter bootstrap 教學(在eclipse中開發)!

在進行下述步驟之前,請先確認您的eclipse與Google appengine的專案已經開啟。

1. 請下載Bootstrap


2.在Appengine專案中建立一個bootstrap資料夾,把剛剛下載的檔案解壓縮至bootstrap資料夾


3. 在eclipse裡新增一個html檔案


4. 在新增的html檔案中宣告bootstrap連結


最後要怎麼設定與編排就靠你們自己了,掰掰

好心的維尼就在給你一個中文的bootstrap網站吧!