Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

base_path获取问题 #35

Open
vc5 opened this issue Nov 29, 2017 · 2 comments
Open

base_path获取问题 #35

vc5 opened this issue Nov 29, 2017 · 2 comments

Comments

@vc5
Copy link

vc5 commented Nov 29, 2017

测试环境: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''
@vc5 vc5 mentioned this issue Nov 29, 2017
@sailsgo
Copy link

sailsgo commented Jan 20, 2018

i am also

@vc5
Copy link
Author

vc5 commented Jan 20, 2018

you can check my pull request#36 to solve it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants