5👍
✅
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"))
2👍
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"))
- [Django]-Django posts and responses
- [Django]-Form loses ability to send POST requests after 2 ajax updates
0👍
Also, for Django>=3.1, the path module is included in place of the os module. Therefore, use:
'NAME': str(BASE_DIR / 'db.sqlite3')
So, DB sqlite3 settings will look like this in settings.py.
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': str(BASE_DIR / 'db.sqlite3')
}
}
- [Django]-TypeError at /registration __init__() got an unexpected keyword argument 'null'
- [Django]-Can't get proper response from `issubclass()` when called with Django's `__fake__` model type inside migration
- [Django]-How to change the height of the parent div of a plotly_app iframe in python/django?
- [Django]-Reverse lookup on Django m2m field?
Source:stackexchange.com