# OperationalError at /users/ no such table: auth_user

What could be the source of the error below

OperationalError at /users/

no such table: auth_user

Request Method: GET
Request URL: http://127.0.0.1:4000/users/
Django Version: 4.0.10
Exception Type: OperationalError
Exception Value: no such table: auth_user
Exception Location: C:\Users\DEVPOINT\Desktop\My-hire-backend\env\Lib\site-packages\django\db\backends\sqlite3\base.py, line 477, in execute
Python Executable: C:\Users\DEVPOINT\Desktop\My-hire-backend\env\scripts\python.exe
Python Version: 3.11.5
Python Path: [‘C:\Users\DEVPOINT\Desktop\My-hire-backend’, ‘C:\Users\DEVPOINT\AppData\Local\Programs\Python\Python311\python311.zip’, ‘C:\Users\DEVPOINT\AppData\Local\Programs\Python\Python311\DLLs’, ‘C:\Users\DEVPOINT\AppData\Local\Programs\Python\Python311\Lib’, ‘C:\Users\DEVPOINT\AppData\Local\Programs\Python\Python311’, ‘C:\Users\DEVPOINT\Desktop\My-hire-backend\env’, ‘C:\Users\DEVPOINT\Desktop\My-hire-backend\env\Lib\site-packages’]

Two possibilities come to mind right off-hand.

  • You did not run migrate to create your base models.

  • You don’t have django.contrib.auth in your INSTALLED_APPS setting.

A less-likely possibility is that you used to have a custom user model and have removed the setting for it from your settings.py file.

There’s also the chance that someone dropped that table from the database.

Oh Thanks for your response I had to delete my sqlite database and ran migrations for all the differents apps moreover for the accounts app where I think the error is coming from.

Anyways it worked thank you so much

1 Like