This prompt probably says: “Type error: The operation type is not supported as string and string”, directly put the two strings (BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__ ))) It is improper to connect in the list as the basic path, that is, the path of the entire project. Here the system understands “/” as a division sign, and the system understands it as “string/string”. In fact, what I want to express here is to concatenate BASE_DIR and’templates’ together to form a complete path, and “/” is the path separator.
Solution: change the settings.py'DIRS': [BASE_DIR / 'templates'] 修改为 'DIRS': [str.format(BASE_DIR,'/templates']
Or’DIRS’: [(‘%s/templates’)% BASE_DIR]
Or’DIRS’: [os.path.join(BASE_DIR,’templates’)] can also be solved
Similar Posts:
- caffe35793;- 38382;- 39064;src/caffe/net. cpp:8 :18: fatal error: hdf5.h: No such file or directory compilation term…
- Cmake: How to Connect boost Library
- [How to Use] System.getProperty(“user.dir”)
- Web service, download the file linked with HTTPS, and prompt javax.net.ssl.sslkeyexception: RSA premaster secret error
- “No module named context_processors”
- ERRORS: ?: (corsheaders.E013) Origin ‘*’ in CORS_ORIGIN_WHITELIST is missing scheme or ne…
- [Solved] Using jdk11 to deploy Nacos under Linux, the startup error is: could not find or load main class
- ‘_getfullpathname: path should be string, bytes or os.PathLike, not tuple’ This error is always reported when debugging the upload file interface
- How to Solve Python SyntaxError: EOL while scanning string literal
- C# call Python error no module named OS [How to Solve]