소스 검색

Set a default WAGTAILDOCS_EXTENSIONS list in project template

Matt Westcott 1 년 전
부모
커밋
f39a91a67e
1개의 변경된 파일6개의 추가작업 그리고 0개의 파일을 삭제
  1. 6 0
      wagtail/project_template/project_name/settings/base.py

+ 6 - 0
wagtail/project_template/project_name/settings/base.py

@@ -172,3 +172,9 @@ WAGTAILSEARCH_BACKENDS = {
 # Base URL to use when referring to full URLs within the Wagtail admin backend -
 # e.g. in notification emails. Don't include '/admin' or a trailing slash
 WAGTAILADMIN_BASE_URL = "http://example.com"
+
+# Allowed file extensions for documents in the document library.
+# This can be omitted to allow all files, but note that this may present a security risk
+# if untrusted users are allowed to upload files -
+# see https://docs.wagtail.org/en/stable/advanced_topics/deploying.html#user-uploaded-files
+WAGTAILDOCS_EXTENSIONS = ['7z', 'bz2', 'csv', 'docx', 'gz', 'key', 'odt', 'pdf', 'pptx', 'rar', 'rtf', 'tar', 'txt', 'xlsx', 'zip']