frappe应用开发命令示例

## 打开终端A

```

cd ~

pyenv activate frappe

bench init sbang --frappe-path=https://gitee.com/qinyanwan/frappe

cd ~/sbang/apps/frappe/

git fetch --all --tags

git checkout tags/v13.26.0 -b v13.26.0-branch

git branch

bench build --app frappe

bench get-app https://gitee.com/phipsoft/erpnext.git

cd ~/sbang/apps/erpnext/

git fetch --all --tags

git checkout tags/v13.26.0 -b v13.26.0-branch

git branch

bench build --app erpnext

bench get-app https://gitee.com/yuzelin/erpnext_chinese.git

bench get-app https://gitee.com/yuzelin/erpnext_oob.git

bench get-app https://gitee.com/yuzelin/zelin_permission.git

bench new-site sbang13dev

bench --site sbang13dev install-app erpnext

bench --site sbang13dev install-app erpnext_chinese

bench --site sbang13dev install-app erpnext_oob

bench --site sbang13dev install-app zelin_permission

bench --site sbang13dev restore 20220424_153416-sbang13dev-database.sql.gz --with-public-files 20220424_153416-sbang13dev-files.tar --with-private-files 20220424_153416-sbang13dev-private-files.tar

```

## 打开终端B

```

screen -S sbang13dev

pyenv activate frappe

bench set-config -g developer_mode 1

bench start

```

## 回到终端A

```

bench --site sbang13dev migrate

bench --site sbang13dev list-apps

```

### 备份

```

bench --site sbang13dev backup --with-files

ls ~/sbang/sites/sbang13dev/private/backups/

```

## 开发环境

```

frappe          13.26.0 v13.26.0-branch

erpnext          13.26.0 v13.26.0-branch

erpnext_chinese  13.0.0  master

erpnext_oob      13.0.0  master

zelin_permission 0.0.1  master

```

## 新建App

```

bench new-app app_sbang

cd ~/sbang/apps/app_sbang/

git remote add origin https://e.coding.net/kirinsoar/app/app_sbang.git

git push -u origin master

bench --site sbang13dev install-app app_sbang

bench --site sbang13dev migrate

```

## git push App

```

cd ~/sbang/apps/app_sbang/

bench --site sbang13dev export-fixtures

bench --site sbang13dev export-fixtures --app app_sbang

git add .

git commit -m "export-fixtures"

git push

```

## 有时 bench start 不工作了,报错如下

```

15:29:43 system          | redis_cache.1 started (pid=5556)

15:29:43 redis_cache.1    | 5563:C 25 Apr 2022 15:29:43.558 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo

15:29:43 redis_cache.1    | 5563:C 25 Apr 2022 15:29:43.558 # Redis version=5.0.7, bits=64, commit=00000000, modified=0, pid=5563, just started

15:29:43 redis_cache.1    | 5563:C 25 Apr 2022 15:29:43.558 # Configuration loaded

15:29:43 redis_cache.1    | 5563:M 25 Apr 2022 15:29:43.559 * Increased maximum number of open files to 10032 (it was originally set to 1024).

15:29:43 redis_cache.1    | 5563:M 25 Apr 2022 15:29:43.560 * Running mode=standalone, port=13005.

15:29:43 redis_cache.1    | 5563:M 25 Apr 2022 15:29:43.560 # Server initialized

15:29:43 redis_cache.1    | 5563:M 25 Apr 2022 15:29:43.560 # WARNING overcommit_memory is set to 0! Background save may fail under low memory condition. To fix this issue add 'vm.overcommit_memory = 1' to /etc/sysctl.conf and then reboot or run the command 'sysctl vm.overcommit_memory=1' for this to take effect.

15:29:43 redis_cache.1    | 5563:M 25 Apr 2022 15:29:43.560 # WARNING you have Transparent Huge Pages (THP) support enabled in your kernel. This will create latency and memory usage issues with Redis. To fix this issue run the command 'echo never > /sys/kernel/mm/transparent_hugepage/enabled' as root, and add it to your /etc/rc.local in order to retain the setting after a reboot. Redis must be restarted after THP is disabled.

15:29:43 redis_cache.1    | 5563:M 25 Apr 2022 15:29:43.560 * Ready to accept connections

15:29:43 system          | redis_queue.1 started (pid=5560)

15:29:43 redis_queue.1    | 5575:C 25 Apr 2022 15:29:43.563 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo

15:29:43 redis_queue.1    | 5575:C 25 Apr 2022 15:29:43.563 # Redis version=5.0.7, bits=64, commit=00000000, modified=0, pid=5575, just started

15:29:43 redis_queue.1    | 5575:C 25 Apr 2022 15:29:43.563 # Configuration loaded

15:29:43 redis_queue.1    | 5575:M 25 Apr 2022 15:29:43.564 * Increased maximum number of open files to 10032 (it was originally set to 1024).

15:29:43 redis_queue.1    | 5575:M 25 Apr 2022 15:29:43.564 * Running mode=standalone, port=11005.

15:29:43 redis_queue.1    | 5575:M 25 Apr 2022 15:29:43.564 # Server initialized

15:29:43 redis_queue.1    | 5575:M 25 Apr 2022 15:29:43.564 # WARNING overcommit_memory is set to 0! Background save may fail under low memory condition. To fix this issue add 'vm.overcommit_memory = 1' to /etc/sysctl.conf and then reboot or run the command 'sysctl vm.overcommit_memory=1' for this to take effect.

15:29:43 redis_queue.1    | 5575:M 25 Apr 2022 15:29:43.564 # WARNING you have Transparent Huge Pages (THP) support enabled in your kernel. This will create latency and memory usage issues with Redis. To fix this issue run the command 'echo never > /sys/kernel/mm/transparent_hugepage/enabled' as root, and add it to your /etc/rc.local in order to retain the setting after a reboot. Redis must be restarted after THP is disabled.

15:29:43 redis_queue.1    | 5575:M 25 Apr 2022 15:29:43.564 * Ready to accept connections

15:29:43 system          | redis_socketio.1 started (pid=5559)

15:29:43 redis_socketio.1 | 5569:C 25 Apr 2022 15:29:43.560 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo

15:29:43 redis_socketio.1 | 5569:C 25 Apr 2022 15:29:43.560 # Redis version=5.0.7, bits=64, commit=00000000, modified=0, pid=5569, just started

15:29:43 redis_socketio.1 | 5569:C 25 Apr 2022 15:29:43.560 # Configuration loaded

15:29:43 redis_socketio.1 | 5569:M 25 Apr 2022 15:29:43.561 * Increased maximum number of open files to 10032 (it was originally set to 1024).

15:29:43 redis_socketio.1 | 5569:M 25 Apr 2022 15:29:43.561 * Running mode=standalone, port=12005.

15:29:43 redis_socketio.1 | 5569:M 25 Apr 2022 15:29:43.561 # Server initialized

15:29:43 redis_socketio.1 | 5569:M 25 Apr 2022 15:29:43.561 # WARNING overcommit_memory is set to 0! Background save may fail under low memory condition. To fix this issue add 'vm.overcommit_memory = 1' to /etc/sysctl.conf and then reboot or run the command 'sysctl vm.overcommit_memory=1' for this to take effect.

15:29:43 redis_socketio.1 | 5569:M 25 Apr 2022 15:29:43.561 # WARNING you have Transparent Huge Pages (THP) support enabled in your kernel. This will create latency and memory usage issues with Redis. To fix this issue run the command 'echo never > /sys/kernel/mm/transparent_hugepage/enabled' as root, and add it to your /etc/rc.local in order to retain the setting after a reboot. Redis must be restarted after THP is disabled.

15:29:43 redis_socketio.1 | 5569:M 25 Apr 2022 15:29:43.561 * Ready to accept connections

15:29:43 system          | web.1 started (pid=5567)

15:29:43 system          | worker_long.1 started (pid=5591)

15:29:43 system          | worker_default.1 started (pid=5595)

15:29:43 system          | socketio.1 started (pid=5566)

15:29:43 system          | worker_short.1 started (pid=5593)

15:29:43 system          | watch.1 started (pid=5602)

15:29:43 system          | schedule.1 started (pid=5589)

15:29:43 socketio.1      | listening on *: 9005

15:29:45 system          | worker_short.1 stopped (rc=2)

15:29:45 system          | sending SIGTERM to redis_cache.1 (pid 5556)

15:29:45 system          | sending SIGTERM to redis_socketio.1 (pid 5559)

15:29:45 system          | sending SIGTERM to redis_queue.1 (pid 5560)

15:29:45 system          | sending SIGTERM to web.1 (pid 5567)

15:29:45 system          | sending SIGTERM to socketio.1 (pid 5566)

15:29:45 system          | sending SIGTERM to watch.1 (pid 5602)

15:29:45 system          | sending SIGTERM to schedule.1 (pid 5589)

15:29:45 system          | sending SIGTERM to worker_long.1 (pid 5591)

15:29:45 system          | sending SIGTERM to worker_default.1 (pid 5595)

15:29:45 redis_queue.1    | 5575:signal-handler (1650871785) Received SIGTERM scheduling shutdown...

15:29:45 redis_socketio.1 | 5569:signal-handler (1650871785) Received SIGTERM scheduling shutdown...

15:29:45 system          | socketio.1 stopped (rc=-15)

15:29:45 system          | worker_default.1 stopped (rc=-15)

15:29:45 redis_cache.1    | 5563:signal-handler (1650871785) Received SIGTERM scheduling shutdown...

15:29:45 system          | web.1 stopped (rc=-15)

15:29:45 system          | watch.1 stopped (rc=-15)

15:29:45 system          | worker_long.1 stopped (rc=-15)

15:29:45 redis_queue.1    | 5575:M 25 Apr 2022 15:29:45.077 # User requested shutdown...

15:29:45 redis_queue.1    | 5575:M 25 Apr 2022 15:29:45.078 * Removing the pid file.

15:29:45 redis_queue.1    | 5575:M 25 Apr 2022 15:29:45.078 # Redis is now ready to exit, bye bye...

15:29:45 system          | redis_queue.1 stopped (rc=-15)

15:29:45 system          | schedule.1 stopped (rc=-15)

15:29:45 redis_cache.1    | 5563:M 25 Apr 2022 15:29:45.164 # User requested shutdown...

15:29:45 redis_cache.1    | 5563:M 25 Apr 2022 15:29:45.164 * Removing the pid file.

15:29:45 redis_cache.1    | 5563:M 25 Apr 2022 15:29:45.164 # Redis is now ready to exit, bye bye...

15:29:45 system          | redis_cache.1 stopped (rc=-15)

15:29:45 redis_socketio.1 | 5569:M 25 Apr 2022 15:29:45.167 # User requested shutdown...

15:29:45 redis_socketio.1 | 5569:M 25 Apr 2022 15:29:45.167 * Removing the pid file.

15:29:45 redis_socketio.1 | 5569:M 25 Apr 2022 15:29:45.167 # Redis is now ready to exit, bye bye...

15:29:45 system          | redis_socketio.1 stopped (rc=-15)

```

### 运行

```

bench setup redis

bench setup socketio

bench setup requirements

bench set-config maintenance_mode 0

```

## 当整个网站都无法访问时,有可能是防火墙关了

```

sudo iptables -t nat -P INPUT ACCEPT   

sudo iptables -t nat -F

sudo iptables -P INPUT ACCEPT

sudo iptables -F

```

©著作权归作者所有,转载或内容合作请联系作者
  • 序言:七十年代末,一起剥皮案震惊了整个滨河市,随后出现的几起案子,更是在滨河造成了极大的恐慌,老刑警刘岩,带你破解...
    沈念sama阅读 216,496评论 6 501
  • 序言:滨河连续发生了三起死亡事件,死亡现场离奇诡异,居然都是意外死亡,警方通过查阅死者的电脑和手机,发现死者居然都...
    沈念sama阅读 92,407评论 3 392
  • 文/潘晓璐 我一进店门,熙熙楼的掌柜王于贵愁眉苦脸地迎上来,“玉大人,你说我怎么就摊上这事。” “怎么了?”我有些...
    开封第一讲书人阅读 162,632评论 0 353
  • 文/不坏的土叔 我叫张陵,是天一观的道长。 经常有香客问我,道长,这世上最难降的妖魔是什么? 我笑而不...
    开封第一讲书人阅读 58,180评论 1 292
  • 正文 为了忘掉前任,我火速办了婚礼,结果婚礼上,老公的妹妹穿的比我还像新娘。我一直安慰自己,他们只是感情好,可当我...
    茶点故事阅读 67,198评论 6 388
  • 文/花漫 我一把揭开白布。 她就那样静静地躺着,像睡着了一般。 火红的嫁衣衬着肌肤如雪。 梳的纹丝不乱的头发上,一...
    开封第一讲书人阅读 51,165评论 1 299
  • 那天,我揣着相机与录音,去河边找鬼。 笑死,一个胖子当着我的面吹牛,可吹牛的内容都是我干的。 我是一名探鬼主播,决...
    沈念sama阅读 40,052评论 3 418
  • 文/苍兰香墨 我猛地睁开眼,长吁一口气:“原来是场噩梦啊……” “哼!你这毒妇竟也来了?” 一声冷哼从身侧响起,我...
    开封第一讲书人阅读 38,910评论 0 274
  • 序言:老挝万荣一对情侣失踪,失踪者是张志新(化名)和其女友刘颖,没想到半个月后,有当地人在树林里发现了一具尸体,经...
    沈念sama阅读 45,324评论 1 310
  • 正文 独居荒郊野岭守林人离奇死亡,尸身上长有42处带血的脓包…… 初始之章·张勋 以下内容为张勋视角 年9月15日...
    茶点故事阅读 37,542评论 2 332
  • 正文 我和宋清朗相恋三年,在试婚纱的时候发现自己被绿了。 大学时的朋友给我发了我未婚夫和他白月光在一起吃饭的照片。...
    茶点故事阅读 39,711评论 1 348
  • 序言:一个原本活蹦乱跳的男人离奇死亡,死状恐怖,灵堂内的尸体忽然破棺而出,到底是诈尸还是另有隐情,我是刑警宁泽,带...
    沈念sama阅读 35,424评论 5 343
  • 正文 年R本政府宣布,位于F岛的核电站,受9级特大地震影响,放射性物质发生泄漏。R本人自食恶果不足惜,却给世界环境...
    茶点故事阅读 41,017评论 3 326
  • 文/蒙蒙 一、第九天 我趴在偏房一处隐蔽的房顶上张望。 院中可真热闹,春花似锦、人声如沸。这庄子的主人今日做“春日...
    开封第一讲书人阅读 31,668评论 0 22
  • 文/苍兰香墨 我抬头看了看天上的太阳。三九已至,却和暖如春,着一层夹袄步出监牢的瞬间,已是汗流浃背。 一阵脚步声响...
    开封第一讲书人阅读 32,823评论 1 269
  • 我被黑心中介骗来泰国打工, 没想到刚下飞机就差点儿被人妖公主榨干…… 1. 我叫王不留,地道东北人。 一个月前我还...
    沈念sama阅读 47,722评论 2 368
  • 正文 我出身青楼,却偏偏与公主长得像,于是被迫代替她去往敌国和亲。 传闻我的和亲对象是个残疾皇子,可洞房花烛夜当晚...
    茶点故事阅读 44,611评论 2 353

推荐阅读更多精彩内容