Django - A server error occurred. Please contact the administrator

版本:Django2.1 python3.6 CentOS6.8 FDFS

Django - A server error occurred. Please contact the administrator
在admin后台管理测试文件存储类,改变了Django的存储行为,把文件存储到FDFS中,一切进行顺利,但是在点击“保存”时,弹出页面,就只有一句话,就是”A server error occurred. Please contact the administrator”,我一头雾水,这也不是错误,也没有什么信息,在网上搜索一下,也没啥解决方法,只知道是setting.py文件的配置出错了。
改变Django的存储行为在setting.py就配置了一句
DEFAULT_FILE_STORAGE = ‘utils.fdfs.storage.FDFSStorage’(这是自己写的方法)
这个是固定写法,也没啥好改的,但是就是这里出错了!!!
我想我大概是程式有错误吧,但最后检查了程序也没有错。后来我直接在终端进行FDFS存储测试,输出测试程序

from fdfs_client.client import Fdfs_client
client = Fdfs_client(‘/etc/fdfs/client.conf’)
ret = client.upload_by_filename(/home/cole/python/test/test1.py’)

然后报警了!

ret=client.upload_by_filename(‘/home/cole/python/test/test1.py’)
[-] Error: 111 connect to 192.168.226.3:22122. Connection refused.
[-] Error: 111 connect to 192.168.226.3:22122. Connection refused.
[-] Error: 111 connect to 192.168.226.3:22122. Connection refused.
[-] Error: 111 connect to 192.168.226.3:22122. Connection refused.
[-] Error: 111 connect to 192.168.226.3:22122. Connection refused.
[-] Error: 111 connect to 192.168.226.3:22122. Connection refused.
[-] Error: 111 connect to 192.168.226.3:22122. Connection refused.
[-] Error: 111 connect to 192.168.226.3:22122. Connection refused.
[-] Error: 111 connect to 192.168.226.3:22122. Connection refused.
[-] Error: 111 connect to 192.168.226.3:22122. Connection refused.

这下终于水落石出了,原来是我没有开户FDFS服务!

fdfs_trackerd /etc/fdfs/tracker.conf
fdfs_storaged /etc/fdfs/storage.conf

开户FDFS服务之后,一切正常!