# Media files not showing when debug is false

**URL:** <https://forum.djangoproject.com/t/media-files-not-showing-when-debug-is-false/16297>\
**Category:** Show & Tell\
**Created:** [October 2, 2022, 12:30pm UTC](https://forum.djangoproject.com/t/media-files-not-showing-when-debug-is-false/16297 "2022-10-02T12:30:02Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Boyambassador](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/boyambassador/32/10280_2.png) [@Boyambassador](https://forum.djangoproject.com/u/Boyambassador)\
**Post date:** [October 2, 2022, 12:30pm UTC](https://forum.djangoproject.com/t/media-files-not-showing-when-debug-is-false/16297/1 "2022-10-02T12:30:02Z")

</div>

My media files are not showing when i try to access them with debug false and using python manage.py runserver

---

<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:** [October 2, 2022, 1:21pm UTC](https://forum.djangoproject.com/t/media-files-not-showing-when-debug-is-false/16297/2 "2022-10-02T13:21:47Z")

</div>

See the `insecure` parameter of the [`runserver`](https://docs.djangoproject.com/en/3.2/ref/contrib/staticfiles/#runserver) command.

---

<div class="post-metadata">

**Author:** ![Spha](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/spha/32/9509_2.png) [@Spha](https://forum.djangoproject.com/u/Spha)\
**Post date:** [October 11, 2022, 12:52pm UTC](https://forum.djangoproject.com/t/media-files-not-showing-when-debug-is-false/16297/3 "2022-10-11T12:52:01Z")

</div>

It’s normal behavior. Setting debug to false is for the purpose of Django application deployment.

as quoted from the documentation:

> Django doesn’t serve files itself; it leaves that job to whichever web server you choose.
> 
> We recommend using a separate web server – i.e., one that’s not also running Django – for \> serving media. Here are some good choices:
> 
> - [Nginx](https://nginx.org/en/)
> - A stripped-down version of [Apache](https://httpd.apache.org/)

> **[Django](https://docs.djangoproject.com/en/4.1/howto/deployment/wsgi/modwsgi/#serving-files)**
>
> The web framework for perfectionists with deadlines.

I used NGINX to serve images in a http deployment, and then the images worked when debug = false.
