There you are, debugging using pdb or ipdb, trying to ship the latest build of an important project. You are running PostgreSQL, yet a pesky SQLite error continues to interrupt your workflow:

ProgrammingError: SQLite objects created in a thread can only be used in that same thread.

You have tried everything! Googling indicates that there is no shortage of Pythonistas out there who have experienced the same problem, but no solution is available.

What do you do? What do you do?

What do you do? What do you do?

I’ll tell you what you do! You run your server without threading. That is the solution. I don’t understand why Django seems to think SQLite is running when you are using PostgreSQL, but the following command will allow you to circumvent the issue and continue with your work.

python manage.py runserver –nothreading

Happy coding!