django-qiniu-storage
django-qiniu-storage copied to clipboard
base_path获取问题
trafficstars
测试环境:WIN10 X64 Python3.6.2 setting如下
STATIC_ROOT = os.path.join(BASE_DIR, 'collectstatic')
……
DEFAULT_FILE_STORAGE = 'qiniustorage.backends.QiniuStorage'
STATICFILES_STORAGE = 'qiniustorage.backends.QiniuStaticStorage'
报错如下
File "D:\Anaconda3\lib\site-packages\django\contrib\staticfiles\management\commands\collectstatic.py", line 260, in delete_file
if self.storage.exists(prefixed_path):
File "D:\Anaconda3\lib\site-packages\qiniustorage\backends.py", line 154, in exists
stats = self._file_stat(name, silent=True)
File "D:\Anaconda3\lib\site-packages\qiniustorage\backends.py", line 145, in _file_stat
name = self._normalize_name(self._clean_name(name))
File "D:\Anaconda3\lib\site-packages\qiniustorage\backends.py", line 108, in _normalize_name
name)
django.core.exceptions.SuspiciousOperation: Attempted access to 'css/bootstrap-theme.css' denied.
开调试获取到_normalize_name函数中的变量如下
base_path = 'E:\\Code\\djprj\\collectstatic'
final_path = ''css/bootstrap-theme.css''
i am also
you can check my pull request#36 to solve it.