# django.db.utils.OperationalError: no such table: app_model

**Code:** `Django no such table` · **Category:** Python · **Seen on:** Python

Django queried a table that hasn’t been created — migrations missing or not applied.

## 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

1. python manage.py makemigrations && python manage.py migrate
2. Commit migration files
3. Use an absolute path for the SQLite NAME (BASE_DIR / "db.sqlite3")

## Detailed fix by platform

### Python

1. `python manage.py showmigrations` lists unapplied migrations

## How to diagnose

1. **Table** — Which table?
2. **Migrations** — Applied on this DB?

---
Source: [WhatIsMyError](https://whatismyerror.com/errors/python/django-operationalerror-no-such-table)
