when im taking my course of django i got this error i don't know how to fix it here is my settings.py
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': BASE_DIR / 'db.sqlite3',
}
}
when im taking my course of django i got this error i don't know how to fix it here is my settings.py
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': BASE_DIR / 'db.sqlite3',
}
}
You have to remove / and + like this
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': BASE_DIR + 'db.sqlite3',
}
}
The tutorial you are following has used a pathlib.Path object for BASE_DIR which supports the / operator for joining paths. You need to either use pathlib or use os.path.join if you use strings
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
}
}