# Problem with Retrieving objects in Django ORM

**URL:** https://forum.codewithmosh.com/t/problem-with-retrieving-objects-in-django-orm/20912
**Category:** Django
**Created:** [June 19, 2023, 2:07pm UTC](https://forum.codewithmosh.com/t/problem-with-retrieving-objects-in-django-orm/20912 "2023-06-19T14:07:19Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![Hanma-san](https://avatars.discourse-cdn.com/v4/letter/h/f07891/32.png) [@Hanma-san](https://forum.codewithmosh.com/u/Hanma-san)
#### Post date: [June 19, 2023, 2:07pm UTC](https://forum.codewithmosh.com/t/problem-with-retrieving-objects-in-django-orm/20912/1 "2023-06-19T14:07:20Z")

</div>

Hello, im working with Django tutorial from Mosh.  
Yesterday i’ve replaced my original “storefront” project with the storefront downloaded from resource files from course files.  
Now on “Retrieving objects” part in tutorial i have problem with my project site.  
I’m working with PyCharm and postgreSQL (i’ve changed DB settings for postgres).  
PROBLEM:

# DoesNotExist at /playground/hello/

Product matching query does not exist.

| Request Method: | GET |
| --- | --- |
| Request URL: | [http://127.0.0.1:8000/playground/hello/](http://127.0.0.1:8000/playground/hello/) |
| Django Version: | 4.2.2 |
| Exception Type: | DoesNotExist |
| Exception Value: | Product matching query does not exist. |
| Exception Location: | C:\Users\wotpr\PycharmProjects\so it has begun\venv\Lib\site-packages\django\db\models\query.py, line 637, in get |
| Raised during: | playground.views.say\_hello |
| Python Executable: | C:\Users\wotpr\PycharmProjects\so it has begun\venv\Scripts\python.exe |
| Python Version: | 3.11.3 |
| Python Path: | [‘C:\Users\wotpr\PycharmProjects\so it has begun\storefront’, ‘C:\Users\wotpr\AppData\Local\Programs\Python\Python311\python311.zip’, ‘C:\Users\wotpr\AppData\Local\Programs\Python\Python311\DLLs’, ‘C:\Users\wotpr\AppData\Local\Programs\Python\Python311\Lib’, ‘C:\Users\wotpr\AppData\Local\Programs\Python\Python311’, ‘C:\Users\wotpr\PycharmProjects\so it has begun\venv’, ‘C:\Users\wotpr\PycharmProjects\so it has begun\venv\Lib\site-packages’] |
| Server time: | Mon, 19 Jun 2023 14:04:29 +0000 |

## Traceback [Switch to copy-and-paste view](http://127.0.0.1:8000/playground/hello/#)

- `C:\Users\wotpr\PycharmProjects\so it has begun\venv\Lib\site-packages\django\core\handlers\exception.py`, line 55, in inner

…

Local vars

| | |
| --- | --- |
| | |
| | |
| | |

- `C:\Users\wotpr\PycharmProjects\so it has begun\venv\Lib\site-packages\django\core\handlers\base.py`, line 197, in \_get\_response

…

Local vars

| | |
| --- | --- |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |

- `C:\Users\wotpr\PycharmProjects\so it has begun\storefront\playground\views.py`, line 6, in say\_hello

…

Local vars

| | |
| --- | --- |
| | |

- `C:\Users\wotpr\PycharmProjects\so it has begun\venv\Lib\site-packages\django\db\models\manager.py`, line 87, in manager\_method

…

Local vars

| | |
| --- | --- |
| | |
| | |
| | |
| | |

- `C:\Users\wotpr\PycharmProjects\so it has begun\venv\Lib\site-packages\django\db\models\query.py`, line 637, in get

---

<div class="post-metadata">

### Author: ![lucidlear](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.codewithmosh.com/lucidlear/32/5477_2.png) [@lucidlear](https://forum.codewithmosh.com/u/lucidlear)
#### Post date: [June 19, 2023, 9:43pm UTC](https://forum.codewithmosh.com/t/problem-with-retrieving-objects-in-django-orm/20912/2 "2023-06-19T21:43:39Z")

</div>

Django is saying there is no product with id=1 (pk) found in the database.

Make sure you have run all your migrations and check your db settings are properly configured like db name, user password etc and server is running and all your models are properly defined.

Also check in pgadmin in the products table that there is a product with primary key 1 exists and you can connect and view that record in the table without errors
