# issue for upgraded to Django 5.0.3

**URL:** <https://forum.djangoproject.com/t/issue-for-upgraded-to-django-5-0-3/29493>\
**Category:** Mystery Errors\
**Created:** [March 26, 2024, 9:12am UTC](https://forum.djangoproject.com/t/issue-for-upgraded-to-django-5-0-3/29493 "2024-03-26T09:12:39Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![liqianqian160](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/liqianqian160/32/20156_2.png) [@liqianqian160](https://forum.djangoproject.com/u/liqianqian160)\
**Post date:** [March 26, 2024, 9:12am UTC](https://forum.djangoproject.com/t/issue-for-upgraded-to-django-5-0-3/29493/1 "2024-03-26T09:12:39Z")

</div>

the issue message as below when I execute ‘python manage.py runserver’, Could you please advise how to fix this warnings message.

Python\Python3.11.3\Lib\site-packages\django\db\backends\utils.py:98: RuntimeWarning: Accessing the database during app initialization is discouraged. To fix this warning, avoid executing queries in AppConfig.ready() or when your app modules are imported.  
warnings.warn(self.APPS\_NOT\_READY\_WARNING\_MSG, category=RuntimeWarning)  
Watching for file changes with StatReloader

---

<div class="post-metadata">

**Author:** ![KenWhitesell](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/kenwhitesell/32/280_2.png) [@KenWhitesell](https://forum.djangoproject.com/u/KenWhitesell)\
**Post date:** [March 26, 2024, 12:07pm UTC](https://forum.djangoproject.com/t/issue-for-upgraded-to-django-5-0-3/29493/2 "2024-03-26T12:07:35Z")

</div>

The most likely cause for this is that you’re executing a database operation in the `ready()` method in an AppConfig class in your apps.py file. See the docs and the warning box at [Applications | Django documentation | Django](https://docs.djangoproject.com/en/5.0/ref/applications/#django.apps.AppConfig.ready).

If that’s not the case, then you need to check your entire code base to find any queries being used outside a function.

---

<div class="post-metadata">

**Author:** ![Murithijoshua](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/murithijoshua/32/21380_2.png) [@Murithijoshua](https://forum.djangoproject.com/u/Murithijoshua)\
**Post date:** [June 12, 2024, 9:07am UTC](https://forum.djangoproject.com/t/issue-for-upgraded-to-django-5-0-3/29493/3 "2024-06-12T09:07:33Z")

</div>

I faced similar issue, I had to rollback to django 4.2.

```auto
pip install django==4.2 

```

Hope this works
