---
# GENERATED FILE — do not edit.
# Source: `manage.py docs_generate` (djust 1.2.0).
# Edit the generator in docs_app/generator.py instead.
title: "Navigation methods"
description: "Navigation methods on the LiveView base class, generated."
level: reference
order: 60
section: reference
generated: true
---
Navigation methods on `LiveView`, generated from the framework manifest.

**2 entries.**

## `live_patch`

```text
self.live_patch(
    params: Optional[Dict[str, Any]] = None,
    path: Optional[str] = None,
    replace: bool = False,
) -> None
```

| Parameter | Default and behavior |
| --- | --- |
| `params` | Default: `None`. `Optional[Dict[str, Any]]`. Query parameters to set. Merged with existing params. Pass None to keep current params, {} to clear them. |
| `path` | Default: `None`. `Optional[str]`. Optional new path. Defaults to current path. |
| `replace` | Default: `False`. `bool`. If True, use replaceState instead of pushState. |

Update browser URL without remounting. Triggers handle_params().

## `live_redirect`

```text
self.live_redirect(
    path: str,
    params: Optional[Dict[str, Any]] = None,
    replace: bool = False,
) -> None
```

| Parameter | Default and behavior |
| --- | --- |
| `path` | **Required.** `str`. URL path to navigate to (e.g. "/items/42/"). |
| `params` | Default: `None`. `Optional[Dict[str, Any]]`. Optional query parameters. |
| `replace` | Default: `False`. `bool`. If True, use replaceState instead of pushState. |

Navigate to a different LiveView over the existing WebSocket (no page reload).

## Choose the right navigation method

| Task | Use |
| --- | --- |
| Change a filter or page number in the current view | `live_patch(params={...})` |
| Move to a different LiveView | `live_redirect(path)` |
| Replace the current history entry | Pass `replace=True` |

### Keep a filter in the URL

```python
from djust.decorators import event_handler

@event_handler()
def filter_results(self, category="all", **kwargs):
    self.category = category
    self.live_patch(params={"category": category, "page": 1})

def handle_params(self, params, uri):
    self.category = params.get("category", "all")
```

Implement `handle_params()` to restore state when the URL changes, including
browser back and forward navigation. See [Navigation](/guides/navigation/) for
links, redirects, query parameters, and complete examples.
