Zephyr 连接地址:
https://github.com/whiteclover/Zephyr
一些改进:
前端能力有限,没有变动,勿吐槽。适合新手学习,有兴趣的可以 fork 自己改造。
以前 flask 版本
https://github.com/whiteclover/white
$ python zephyrd -h
usage: zephyrd [-h] [--asset.url_prefix ASSET.URL_PREFIX]
[--asset.path ASSET.PATH] [--db.db DB.DB] [--db.host DB.HOST]
[--db.user DB.USER] [--db.passwd DB.PASSWD] [--db.port DB.PORT]
[--jinja2.cache_path JINJA2.CACHE_PATH]
[--jinja2.cache_size JINJA2.CACHE_SIZE] [--jinja2.auto_reload]
[--redis.host REDIS.HOST] [--redis.port REDIS.PORT]
[--redis.db REDIS.DB] [--redis.password REDIS.PASSWORD]
[--redis.max_connections REDIS.MAX_CONNECTIONS]
[-H TORNADO.HOST] [-p TORNADO.PORT] [-d] [--language LANGUAGE]
[--theme THEME] [--secert_key SECERT_KEY] [-c FILE]
[-v VERSION]
optional arguments:
-h, --help show this help message and exit
Asset settings:
--asset.url_prefix ASSET.URL_PREFIX
Asset url path prefix: (default '/assets/')
--asset.path ASSET.PATH
Asset files path (default
'/code/Zephyr/zephyr/asset')
DB settings:
--db.db DB.DB The database name (default 'zephyr')
--db.host DB.HOST The host of the database (default 'localhost')
--db.user DB.USER The user of the database (default 'zephyr')
--db.passwd DB.PASSWD
The password of the database (default 'zephyr')
--db.port DB.PORT The port of the database (default 3306)
Jinja2 settings:
--jinja2.cache_path JINJA2.CACHE_PATH
Jinja2 cache code byte path: (default None)
--jinja2.cache_size JINJA2.CACHE_SIZE
Jinja2 cache size: (default -1)
--jinja2.auto_reload Jinja2 filesystem checks (default False)
Redis settings:
--redis.host REDIS.HOST
The host of the redis (default 'localhost')
--redis.port REDIS.PORT
The port of the redis (default 6379)
--redis.db REDIS.DB The db of the redis (default 0)
--redis.password REDIS.PASSWORD
The user of the redis (default None)
--redis.max_connections REDIS.MAX_CONNECTIONS
The max connections of the redis (default None)
Service settings:
-H TORNADO.HOST, --tornado.host TORNADO.HOST
The host of the tornado server (default 'euterpe')
-p TORNADO.PORT, --tornado.port TORNADO.PORT
The port of the tornado server (default 8888)
-d, --debug Open debug mode (default False)
--language LANGUAGE The language for the site (default 'en_GB')
--theme THEME The theme for the site (default 'default')
--secert_key SECERT_KEY
The secert key for secure cookies (default
'7oGwHH8NQDKn9hL12Gak9G/MEjZZYk4PsAxqKU4cJoY=')
-c FILE, --config FILE
config path (default '/etc/zephyr/app.conf')
-v VERSION, --version VERSION
Show zephyr version 0.1.0a
Currently, using hocon config. the primary goal of hocon is: keep the semantics (tree structure; set of types; encoding/escaping) from JSON, but make it more convenient as a human-editable config file format.
# Zehpyr config
tornado {
host = "localhost"
port = 8888
}
# theme = "default"
# languge = "en_GB"
secert_key = "7oGwHH8NQDKn9hL12Gak9G/MEjZZYk4PsAxqKU4cJoY="
debug = off
db {
passwd = "thomas"
user = "root"
host = "localhost"
db = "zephyr"
}
redis {
host = "localhost"
port = 6379
}
//asset {
// url_prefix = "/assets/" // asset url path prefix
// path = "./nodejs/dist/assets" # static files path
//}
jinja2 {
cache_path = "./cache" # mako module cache path, comments it if wanna disable
auto_reload = on
}
这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。
V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。
V2EX is a community of developers, designers and creative people.