archery

发布时间 2023-06-26 14:55:00作者: zenghansen

1、需要用v1.9.1版本,最新版会有配置问题。需要注意在.env文件配置跨域如下:

NGINX_PORT=8000

# https://django-environ.readthedocs.io/en/latest/quickstart.html#usage
# https://docs.djangoproject.com/zh-hans/4.1/ref/settings/
DEBUG=false
DATABASE_URL=mysql://root:123456@mysql:3306/archery
CACHE_URL=redis://redis:6379/0?PASSWORD=123456

# https://docs.djangoproject.com/en/4.0/ref/settings/#csrf-trusted-origins
CSRF_TRUSTED_ORIGINS=http://127.0.0.1:8000

# https://django-auth-ldap.readthedocs.io/en/latest/
ENABLE_LDAP=false
AUTH_LDAP_ALWAYS_UPDATE_USER=true
AUTH_LDAP_USER_ATTR_MAP=username=cn,display=displayname,email=email

# https://django-q.readthedocs.io/en/latest/configure.html#
Q_CLUISTER_WORKERS=4
Q_CLUISTER_TIMEOUT=60
Q_CLUISTER_SYNC=false

其他配置不变,用的是独立的sql和redis。

最后在管理后台配置

此处mysql的配置是内置的mysql而非数据源的mysql。