o ʎ_ @sFddlmZmZddlmZddlmZddlmZGdddZ dS))ImproperlyConfiguredSuspiciousFileOperation)get_app_template_dirs) safe_join)cached_propertyc@sDeZdZddZeddZddZddZed d Z d d Z d S) BaseEnginecCsL|}|d|_t|d|_|d|_|r$tdd|dS)zh Initialize the template engine. `params` is a dict of configuration settings. NAMEDIRSAPP_DIRSzUnknown parameters: {}z, N) copypopnamelistdirsapp_dirsrformatjoin)selfparamsr?/usr/lib/python3/dist-packages/django/template/backends/base.py__init__s  zBaseEngine.__init__cCstd|jj)NzA{} doesn't support loading templates from installed applications.)rr __class____name__)rrrr app_dirnames zBaseEngine.app_dirnamecCtd)zk Create and return a template for the given source code. This method is optional. z>subclasses of BaseEngine should provide a from_string() methodNotImplementedError)r template_coderrr from_string"zBaseEngine.from_stringcCr)z Load and return a template for the given name. Raise TemplateDoesNotExist if no such template exists. z=subclasses of BaseEngine must provide a get_template() methodr)r template_namerrr get_template,r zBaseEngine.get_templatecCs"t|j}|jr|t|j7}|S)zG Return a list of directories to search for templates. )tuplerrrr)r template_dirsrrrr$9s zBaseEngine.template_dirsc cs4|jD]}zt||VWqtyYqwdS)z Iterate over candidate files for template_name. Ignore files that don't lie inside configured template dirs to avoid directory traversal attacks. N)r$rr)rr! template_dirrrriter_template_filenamesDs  z"BaseEngine.iter_template_filenamesN) r __module__ __qualname__rpropertyrrr"rr$r&rrrrr s    rN) django.core.exceptionsrrdjango.template.utilsrdjango.utils._osrdjango.utils.functionalrrrrrrs