在訪問cobbler web界面到時候出現如下提示
python
ssl的報錯日誌以下:web
[root@Cobbler ~]# tail -f /var/log/httpd/ssl_error_log [Mon Jan 07 16:24:53.363029 2019] [:error] [pid 3383] [remote 10.0.0.1:212] mod = importlib.import_module(self.SETTINGS_MODULE) [Mon Jan 07 16:24:53.363032 2019] [:error] [pid 3383] [remote 10.0.0.1:212] File "/usr/lib64/python2.7/importlib/__init__.py", line 37, in import_module [Mon Jan 07 16:24:53.363084 2019] [:error] [pid 3383] [remote 10.0.0.1:212] __import__(name) [Mon Jan 07 16:24:53.363089 2019] [:error] [pid 3383] [remote 10.0.0.1:212] File "/usr/share/cobbler/web/settings.py", line 89, in <module> [Mon Jan 07 16:24:53.363097 2019] [:error] [pid 3383] [remote 10.0.0.1:212] from django.conf.global_settings import TEMPLATE_CONTEXT_PROCESSORS [Mon Jan 07 16:24:53.363124 2019] [:error] [pid 3383] [remote 10.0.0.1:212] ImportError: cannot import name TEMPLATE_CONTEXT_PROCESSORS
查看cobbler的py配置文件django
[root@Cobbler ~]# sed -n '38,41p' /usr/share/cobbler/web/settings.py if django.VERSION[0] == 1 and django.VERSION[1] < 4: ADMIN_MEDIA_PREFIX = '/media/' else: STATIC_URL = '/media/ [root@Cobbler ~]# sed -n '89p' /usr/share/cobbler/web/settings.py from django.conf.global_settings import TEMPLATE_CONTEXT_PROCESSORS
初步判斷應該是pythone-django版本問題bootstrap
#下載pip.py wget https://bootstrap.pypa.io/get-pip.py #調用本地python運行pip.py腳本 python get-pip.py #安裝pip pip install Django==1.8.9 #查看pip版本號 python -c "import django; print(django.get_version())" #重啓httpd systemctl restart httpd
最後完美解決
python2.7