30π
It seems like the setting DATABASES β NAME expects a string, not a Path
object.
In your settings try changing this line
'NAME': BASE_DIR / 'db.sqlite3',
to
'NAME': str(BASE_DIR / 'db.sqlite3'),
so that NAME
is a string instead of a Path
.
The error comes from this line of code django/db/backends/sqlite3/creation.py#L13
and it seems that this commit solves the issue, so in Django v3.1.1
there is no need to use 'NAME': str(BASE_DIR / 'db.sqlite3'),
anymore, just using 'NAME': BASE_DIR / 'db.sqlite3',
should sufice.
3π
I fixed this error by changing the line for database name in file settings.py
to:
'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
- Splitting "admin.py" of a Django project?
- Django Rest Framework filter by date range
- Making inlines conditional in the Django admin
- Many to many relationships with additional data on the relationship
0π
I had a similar issue which I resolved by changing the owner of the files to the current owner and starting the server using the following command sudo -u <user_name> python3 manage.py runserver
. It seems itβs a permission issue.
0π
I had the same issue and resolved it by creating a virtual environment for the project. Run the following command to install the environment: python -m venv learn more from https://docs.python.org/3/tutorial/venv.htmlnv.html
- Django: Set default widget in model definition
- How to use pytest fixtures with django TestCase
- How to set initial values for a ModelForm when instance is also given
- What is the IP address of my heroku application
- Registered models do not show up in admin