Install:
If in ubuntu 14.04
$ sudo apt-get install npm nodejs-legacy
$ npm i
If you meet some problem during npm i
and finally succeed, you might need rm -rf node_modules && npm i
$ node -v
$ curl -o- https://raw.githubusercontent.com/creationix/nvm/master/install.sh | bash && source ~/.nvm/nvm.sh
$ nvm install v6.0.0
# Check node.js version again
$ node -v
$ npm start
then open http://localhost:3000/
JavaScript Style: Airbnb
npm test
檢查npm run reformat
自動重排
請揀其中一臺試驗機,注意Pull request有人佇用無
$ npm run deploy-tshi3
$ npm run deploy-giam7
$ npm run deploy-test
$ npm run deploy
- 共
design/logo正方形.svg
擲去http://realfavicongenerator.net/ - 調顯示的畫面
- 共產生的
favicons.zip
掠落來 - 解壓縮佇專案內
- 用http://realfavicongenerator.net/favicon_checker檢查
後端的設定較麻煩,若只是要改前端,可以不用架後端,直接用線上機就行。 若需要試新功能,可以改apiary,並改前端的後端網址就可以運作了
後端使用臺灣言語平臺。
環境要求Python 3.4+,並放在server-side/
資料夾.
以下指令請在server-side/
裡面執行
sudo apt-get install -y python3-dev libffi-dev libxml2-dev libxslt1-dev rabbitmq-server # 為了編譯, 連google oauth2, message queue
virtualenv venv --python python3 # 設置環境檔
. venv/bin/activate # 載入環境
pip install -r requirements.txt # 裝相關python套件
python manage.py migrate #建立資料庫欄位
sudo apt-get install -y libav-tools # 安裝avconv for Ubuntu
以上即已建立開發用簡單的 sqlite db(/server-side/db.sqlite3),如欲使用 postgres 請參考Postgres設定
需同時開django
、celery worker
跟celery beat
三個服務,可用screen
程式碼若有修改django
會重新載入,celery
需重新啟動
python manage.py runserver
celery -A itaigi worker -l info
celery -A itaigi beat -l info
支援多線程
gunicorn itaigi.wsgi
celery -A itaigi worker -l info
celery -A itaigi beat -l info
可考慮 Process Control System 將 celery
跑在系統背景,例如使用 supervisor
詳情請看臺灣言語資料庫的使用Postgres
echo 'from 佳怡表匯入資料庫 import 走 ; 走()' | python manage.py shell
完整匯入需等待一段時間,等待途中可以繼續做其他事 若只需試驗,可中途中斷
python manage.py createsuperuser
email 和密碼隨意輸入,待會需用此帳密登入
- 用瀏覽器進入 http://localhost:8000/admin
- 輸入剛剛的 email 和密碼登入
- 點選 SOCIAL ACCOUNTS 分類下的 Social applications 的 +Add
- provider:FB
- Client id:2055788134646727
- Secret key:880d339384674341c8bf1e62d8c8e0aa
- 左下角 choose all site
- 其他欄位隨便填
參考Obtain OAuth2 credentials from Google Developers Console
- 申請服務
- 開啟Drive API
- 用Service Account得到一個
服務帳戶json
,假設叫做itaigi-sui2.json
- 將
itaigi-sui2.json
放到 server-side/
假設服務帳戶json
得到itaigi-sui2.json
python manage.py 加sheet的json itaigi-sui2.json https://docs.google.com/spreadsheets/d/1_sXX2CGJsfSUTg-r-RGc4ApU1fPUmuLc2DmUSy4y_Zk/edit#gid=0
python manage.py 顯示全部sheet狀態
sudo apt-get install -y libffi-dev # 為了連google oauth2
git pull
pip install -r requirements.txt
python manage.py migrate
python manage.py 加sheet的json itaigi-9.json https://docs.google.com/spreadsheets/d/1_sXX2CGJsfSUTg-r-RGc4ApU1fPUmuLc2DmUSy4y_Zk/edit#gid=0
MIT License http://g0v.mit-license.org/