Update app.py
Browse files1 unmodified line234567899 unmodified lines19202122232425262728291 unmodified linefrom cheroot import wsgifrom wsgidav.wsgidav_app import WsgiDAVAppfrom wsgidav.fs_dav_provider import FilesystemProvider# Create the files directory and sample.txtfiles_dir = os.path.join(os.path.dirname(os.path.abspath(__file__)), "files")if not os.path.exists(files_dir):os.makedirs(files_dir)9 unmodified lines"provider_mapping": {"/": FilesystemProvider(files_dir)},"http_authenticator": {"domain_controller": None,},"simple_dc": {"user_mapping": {"*": True}}, # No authentication"verbose": 1,}# Create the WSGI application1 unmodified line2345678910111213141516171819209 unmodified lines303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889901 unmodified linefrom cheroot import wsgifrom wsgidav.wsgidav_app import WsgiDAVAppfrom wsgidav.fs_dav_provider import FilesystemProvider# from wsgidav.mw.debug_filter import WsgiDavDebugFilterfrom wsgidav.dir_browser import WsgiDavDirBrowserfrom wsgidav.error_printer import ErrorPrinterfrom wsgidav.http_authenticator import HTTPAuthenticator# from wsgidav.mw.impersonator import Impersonatorfrom wsgidav.mw.cors import Corsfrom wsgidav.request_resolver import RequestResolverDEFAULT_VERBOSE = 3DEFAULT_LOGGER_DATE_FORMAT = "%H:%M:%S"DEFAULT_LOGGER_FORMAT = "%(asctime)s.%(msecs)03d - %(levelname)-8s: %(message)s"files_dir = os.path.join(os.path.dirname(os.path.abspath(__file__)), "files")if not os.path.exists(files_dir):os.makedirs(files_dir)9 unmodified lines"provider_mapping": {"/": FilesystemProvider(files_dir)},"middleware_stack": [# WsgiDavDebugFilter,Cors,ErrorPrinter,HTTPAuthenticator,# Impersonator,WsgiDavDirBrowser, # configured under dir_browser option (see below)RequestResolver, # this must be the last middleware item],"http_authenticator": {"domain_controller": None,"accept_basic": True, # Allow basic authentication, True or False"accept_digest": True, # Allow digest authentication, True or False"default_to_digest": True, # True (default digest) or False (default basic)# Name of a header field that will be accepted as authorized user"trusted_auth_header": None,},"simple_dc": {"user_mapping": {"*": {"user":"password": "hunter123","roles": ["editor", "admin"]}}},"verbose": DEFAULT_VERBOSE,"logging": {"enable": True, # True: activate 'wsgidav' logger (in library mode)"logger_date_format": DEFAULT_LOGGER_DATE_FORMAT,"logger_format": DEFAULT_LOGGER_FORMAT,"enable_loggers": [],"debug_methods": [],},"dir_browser": {"enable": True, # Render HTML listing for GET requests on collections# Add a trailing slash to directory URLs (by generating a 301 redirect):"directory_slash": True,# List of fnmatch patterns:"ignore": [".DS_Store", # macOS folder meta data"._*", # macOS hidden data files"Thumbs.db", # Windows image previews],"icon": True,"response_trailer": True, # Raw HTML code, appended as footer (True: use a default)"show_user": True, # Show authenticated user an realm# Send <dm:mount> response if request URL contains '?davmount' (rfc4709)"davmount": True,# Add 'Mount' link at the top"davmount_links": False,"ms_sharepoint_support": False, # Invoke MS Office documents for editing using WebDAV"libre_office_support": False, # Invoke Libre Office documents for editing using WebDAV# The path to the directory that contains template.html and associated assets.# The default is the htdocs directory within the dir_browser directory."htdocs_path": None,},}# Create the WSGI application
app.py+64-3