# Connect Django to SQLEye

> Configure DATABASES in settings.py with HOST 127.0.0.1, the instance port and no password to use a SQLEye PostgreSQL or MySQL instance.

Source: https://sqleye.com/docs/connect/django/ · Last updated: 2026-11-29 · Publisher: CodeROG (https://coderog.com)

Set `DATABASES` in `settings.py` with `HOST` as `127.0.0.1` and the instance's port. Create the database first, see [CLI clients](/docs/connect/cli-clients/).

## How do I configure PostgreSQL?

Django's documentation recommends `psycopg` (3.1.8 or later) as the driver.

```python
DATABASES = {
    "default": {
        "ENGINE": "django.db.backends.postgresql",
        "NAME": "myapp",
        "USER": "postgres",
        "PASSWORD": "",
        "HOST": "127.0.0.1",
        "PORT": "5432",
    }
}
```

## How do I configure MySQL?

Django's documentation recommends `mysqlclient` as the driver.

```python
DATABASES = {
    "default": {
        "ENGINE": "django.db.backends.mysql",
        "NAME": "myapp",
        "USER": "root",
        "PASSWORD": "",
        "HOST": "127.0.0.1",
        "PORT": "3306",
    }
}
```

Replace the port with your instance's port, then run `python manage.py migrate`.

Source: [Django database notes](https://docs.djangoproject.com/en/5.2/ref/databases/). To watch the queries Django's ORM generates, [turn on capture](/docs/live-eye/capture/).
