This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1. [python 3.6 をインストール](https://gist.github.com/moriya9n/22daf53cae550fa91e365e1acd4d7f8a)する。 venv で仮想環境を作っておく。 | |
2. pip install django | |
3. django-admin startproject hogehoge | |
4. レンタルサーバの仕様上、cgi でしか動作しないので、 django-cgi(https://github.com/chibiegg/django-cgi/blob/master/django-python3.cgi) | |
を取ってくる。(速度は期待できない) | |
5. cgi の先頭の python パス名は変更。sys.path.append でプロジェクトディレクトリを追加。 | |
6. index.cgi などにリネームして、好きなところに配置。 | |
7. /home/your_account/static などを作って、settings.py に STATIC_ROOT = '/home/your_account/static' を追加。python manage.py collectstatic | |
を実行。 | |
8. ln -s /home/your_account/static /home/your_account/www/site_name/static |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
setenv.bat に以下のように書いて、startup.bat を実行する。 | |
JAVA_OPTS=の後ろには "" 不要。 | |
set JAVA_OPTS=-Duser.language=ja -Duser.country=JP -Dspring.profiles.active=dev -Dfile.encoding=UTF-8 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// reqJson に json.Marshal したものが入っているとする | |
// APIHost = "webservices.amazon.co.jp" | |
// APIRegion = "us-west-2" | |
// APITarget = "com.amazon.paapi5.v1.ProductAdvertisingAPIv1.SearchItems" | |
// APIService = "ProductAdvertisingAPI" | |
bodyReader := bytes.NewReader(reqJson) | |
req, err := http.NewRequest("POST", "https://" + APIHost + "/paapi5/searchitems", bodyReader) | |
log.Println("request:", req) |
OlderNewer