How to display images in Django 1.10
<p>i am not good in django, i use Django 1.10 and now i have problem with image displaying. I read in this version some stuff has changed but i don't get it. Here is what i have now:</p>

<p>settings.py:</p>

<pre><code>BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))

STATIC_DIR = os.path.join(BASE_DIR, 'static')

TEMPLATE_DIR = os.path.join(BASE_DIR, '/templates')

STATICFILES_DIRS = [STATIC_DIR, ]

STATIC_URL = '/static/'

MEDIA_ROOT = 'C:/Users/john/myprojects/goal/website/goal/media/'

MEDIA_URL = '/media/'
</code></pre>

<p>Maybe something is unusual here and i can delete it?</p>

<p>template:</p>

<pre><code>{% block content%}
    {{ car.name }}
    {{ car.photo.url }}
{% endblock %}
</code></pre>

<p>Here is folder where i have my images:</p>

<blockquote>
  <p>C:/Users/john/myprojects/goal/website/goal/media/images</p>
</blockquote>

<p>And what i see instead of image on my website:</p>

<blockquote>
  <p>/media/images/mynewcar.jpg</p>
</blockquote>

<p>What must i change?</p>

<p>i pasted to urls.py:</p>

<blockquote>
  <p>media_dir = os.path.join(os.path.dirname(<strong>file</strong>),'media')</p>
</blockquote>

<p>and to urlpatterns</p>

<blockquote>
  <p>url(r'^media/(.*)$','django.views.static.serve',{'document_root':
  media_dir}),</p>
</blockquote>

<p>You have to put <code>&lt;img&gt;</code> tag</p>

<pre><code>{% block content%}
    {{ car.name }}
    &lt;img src="{{ car.photo.url }}"&gt;
{% endblock %}
</code></pre>

<p><strong>Update</strong></p>

<pre><code>from django.conf import settings
from django.conf.urls.static import static

urlpatterns = [
    # ... the rest of your URLconf goes here ...
] + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
</code></pre>

python django