Getting a typeError error in django project

前端 未结 2 1582
礼貌的吻别
礼貌的吻别 2020-12-11 12:29

I created a virtual environment for my new project, installed django and started the new project. However, whenever i run a line of code with manage.py i get this long error

相关标签:
2条回答
  • 2020-12-11 12:41

    Make sure you really execute your command in the venv (you should see (venv))

    If you are then as @iklinac said, this should fixe your issue:

    'NAME': str(os.path.join(BASE_DIR, "db.sqlite3"))
    
    0 讨论(0)
  • 2020-12-11 12:53

    It does seem NAME is being converted to pathlib.Path (WindowsPath) object instead of string which then cannot be used in Django in same way as os.path expects strings (Not 100% sure as did not investigate in depth)

    So casting in string would be appropriate

    'NAME': str(os.path.join(BASE_DIR, "db.sqlite3"))
    
    0 讨论(0)
提交回复
热议问题