Reputation:
I am deploying
a project on PythonAnywhere
. I am using sqlite
database.
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': 'mydatabase.db',
}
}
When makemigrations
starts, the file mydatabase.db
is created (its size is 0 bytes) in root of the project, but I get an error - django.db.utils.OperationalError: no such table: ...
Upvotes: 1
Views: 878
Reputation:
The error was due to my carelessness.
In django, views.py
is performed before migrations
. There was a line that ran a database query
. Since the database
was empty on the server, and the script was already executing a request to it, it is obvious that during the migrations
I received this error.
It was enough just to delete / comment out the database request.
Upvotes: 1