django.db.utils.OperationalError: no such table: app_model
Django queried a table that hasn’t been created — migrations missing or not applied.
Seen on:
Python
Meaning
New models need makemigrations + migrate. With SQLite, a different working directory can also point Django at a fresh empty database file.
Common causes
- makemigrations/migrate not run
- Migration files not committed
- Wrong DATABASES path (new empty SQLite file)
- Tests using a database without migrations
⚡ Quick fix
- python manage.py makemigrations && python manage.py migrate
- Commit migration files
- Use an absolute path for the SQLite NAME (BASE_DIR / "db.sqlite3")
Detailed fix by platform
Python
python manage.py showmigrationslists unapplied migrations
How to diagnose
- Table — Which table?
- Migrations — Applied on this DB?
🧠 Still stuck? Analyze your error
Paste the full message, response headers or stack trace — we'll detect the platform and point to the most likely cause.
Was this page helpful?
Report a correction or suggest an improvement
Last updated 2 Oct 2026