djagno-nacos-app
Project description
1、适用于Django服务程序注册微服务实例至nacos服务中心; 2、实现了服务与注册中心的登录授权,服务注册,心跳检测,服务调用负载均衡; 3、cloud模块作为一个django app注册,在INSTALLED_APPS加入'nacos_app.apps.NacosRegisterConfig' 4、django程序需要在settings环境中配置服务注册的信息NACOS_SERVER_DISCOVERY 5、gunicorn多个worker模式下启动需要添加--preload参数,由管理进程预加载非函数式编程中的代码块,从而避免多个worker同时加载register gunicorn backend.wsgi -w 8 -b 0.0.0.0:port -t 600 --preload NACOS_SERVER_DISCOVERY = { "server_addr": "", # nacos服务中心地址 "namespace": "", # 命名空间 "group_name": "", # 分组 "ip": "", # 本机ip "port": "", # 本机服务端口 "service_name": "", # 本机服务名称 "ephemeral": True, # 是否临时实例,true为临时实例,临时实例用于服务临时扩展,过后丢弃 "username": "", # 拥有对应命名空间权限的账户 "password": "", # 密码 "heartbeat_interval": 6 # 心跳检测间隔,单位秒 }
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for nacos_app-1.1.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 88f0ddb2b1fc22522359e11a1bc23d8d073602b53fd4f6faf73a317a801c108f |
|
MD5 | 00e77fc4076dc0cb8d7a909c8275a1ff |
|
BLAKE2b-256 | ab589d74020fd17d7ce9af696e794733cf86778f7491a11ad9239056927aa3c1 |