我正在尝试在 alpine Linux 上安装最新版本的 Ansible 记录分析器服务器我确保所有要求都已安装好(Django、GCC、python3、Pypi、ansible)安装顺利,除了关于缺少的警告我修复的 PATH 变量上的根 PATH :警告:
WARNING: The script pbr is installed in '/root/.local/bin' which is not on PATH.
Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
修复:
~ # export PATH=/root/.local/bin:$PATH
因此,按照打算运行服务器的此步骤的安装指南,我遇到了大量错误,就好像运行命令没有找到要执行的所需组件一样,尽管我确信所有组件都已安装:
~ # ara-manage runserver
[ara] No setting found for SECRET_KEY. Generating a random key...
Traceback (most recent call last):
File "/root/.local/bin/ara-manage", line 8, in <module>
sys.exit(main())
File "/root/.local/lib/python3.8/site-packages/ara/server/__main__.py", line 41, in main
if not os.path.exists(settings.ARA_SETTINGS):
File "/root/.local/lib/python3.8/site-packages/django/conf/__init__.py", line 79, in __getattr__
self._setup(name)
File "/root/.local/lib/python3.8/site-packages/django/conf/__init__.py", line 66, in _setup
self._wrapped = Settings(settings_module)
File "/root/.local/lib/python3.8/site-packages/django/conf/__init__.py", line 157, in __init__
mod = importlib.import_module(self.SETTINGS_MODULE)
File "/usr/lib/python3.8/importlib/__init__.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 1014, in _gcd_import
File "<frozen importlib._bootstrap>", line 991, in _find_and_load
File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 671, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 783, in exec_module
File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
File "/root/.local/lib/python3.8/site-packages/ara/server/settings.py", line 263, in <module>
ALLOWED_HOSTS=ALLOWED_HOSTS.to_list(),
AttributeError: 'list' object has no attribute 'to_list'
这种行为背后的原因可能是什么?
好吧,我设法克服了这个问题,问题出在 dynaconf 中,当前版本 3.1.3 无法正确读取 conf 文件,导致服务器运行失败。
同时,唯一的解决方法是安装以前版本的 dynaconf :
仅供参考 dynaconf 已经为回归提出了修复建议:rochacbruno/dynaconf#541
我已经测试过它确实解决了这个问题,它将很快在 dynaconf 3.1.4 中发布。