1、指令
bench new-site xxxxx
这个会创建一个数据库
创建sites/xxxxx 文件夹
sites/library.test
├── indexes
│ └── web_routes
├── locks
├── logs
├── private
│ ├── backups
│ └── files
├── public
│ └── files
└── site_config.json
site_config.json :站点文件配置
public : 该文件夹将包含无需身份验证即可访问的文件。它可以包含无需登录.public就可以访问的网站图像
private :该文件夹将包含任何数据库备份和私有文件。私有文件是用户上传的文件,需要认证才能访问
2、特性
2-1 支持建立多个站点。支持同一端口访问不同站点【这个需要删除sites/currentsite.txt,禁用默认服务】
Frappe将通过将请求的主机名与站点名称相匹配来识别要服务的站点。通过下面的指令来王城locahost的绑定
127.0.0.1 library.test
$ bench --site library.test add-to-hosts
进行站点映射
站点中添加APP
$ bench --site library.test install-app library_management
查看安装的APP
bench --site library.test list-apps
frappe 是默认安装的app
一些站点命令
Python 控制台
bench --site library.test console
MariaDB 控制台
bench --site library.test mariadb
数据库备份
bench --site library.test backup
$ bench --help
Usage: bench frappe [OPTIONS] COMMAND [ARGS]...
Options:
--site TEXT
--profile Profile
--verbose Verbose
--force Force
--help Show this message and exit.
Commands:
add-system-manager Add a new system manager to a site
add-to-email-queue Add an email to the Email Queue
add-to-hosts Add site to hosts
backup Backup
browse Opens the site on web browser
build Minify + concatenate JS and CSS files, build...
build-message-files Build message files for translation
build-search-index
bulk-rename Rename multiple records via CSV file
clear-cache Clear cache, doctype cache and defaults
clear-website-cache Clear website cache
console Start ipython console for a site
data-import Import documents in bulk from CSV or XLSX...
destroy-all-sessions Clear sessions of all users (logs them out)