---
slug: "django-redis-show-by-terminal-shell"
title: "View the Contents of Redis Directly from the Terminal in Django"
description: "This article explains how to directly view the contents of Django Redis using the Django shell."
url: "https://www.ytyng.com/en/blog/django-redis-show-by-terminal-shell"
publish_date: "2022-12-27T10:15:38Z"
created: "2022-12-27T10:15:38Z"
updated: "2026-02-27T06:56:07.202Z"
categories: ["Django"]
keywords: ""
featured_image_url: "https://media.ytyng.com/resize/20250711/0996be54cedb4fb2828db9f77168d71e.png.webp?width=768"
has_video: false
has_music: false
video_urls: []
music_urls: []
lang: "en"
---

# View the Contents of Redis Directly from the Terminal in Django

Here is the method to directly view the contents of Django Redis from the Django shell.

```shell
./manage.py shell
```

```python
from django_redis import get_redis_connection

# Create a Redis connection
r = get_redis_connection('default')

# Get a list of keys with a limit
r.scan(count=1000)

# Get a list of keys with a pattern
r.keys('ranking_cache_*')

# The contents are pickled, so they cannot be read as is
r.get('my_cache_key')

# Unpickle to read the contents
import pickle
pickle.loads(r.get('my_cache_key'))
```
