(Django learning notes)
An error occurred when migrating db with django, so a correction memo.
Include / as a string and combine BASE_DIR and'templates' with the'+' operator.
Terminal (error content)
$ python manage.py migrate
・ ・ ・ ・
・ ・ ・ ・
File "/Users/USERNAME/mybook/mybook/settings.py", line 57, in <module>
'DIRS': [BASE_DIR / 'templates']
TypeError: unsupported operand type(s) for /: 'str' and 'str'
settings.py(Before correction)
'DIRS': [BASE_DIR / 'templates']
settings.py(Revised)
'DIRS': [BASE_DIR + '/templates']
It worked, but maybe it's a problem with the python version and the Django version.
Django DIRS issue(stackoverflow) Introduction to Python Django (3)
Recommended Posts