How can we add images to our Django project?

In This blog, we are going to learn, how can we add images to our Django project.

The first step is to add this code in the settings.py file.

MEDIA_ROOT = os.path.join(BASE_DIR, ‘media’)
MEDIA_URL = ‘/media/’
STATIC_URL = ‘/static/’

Now in index.html add this code.

<img src="{% static 'img/imageName.png' %}" >

Thanks for following this Blog.

How can we add images to our Django project?expoundsofttechsolution How can we add images to our Django project?