django 1.10 media images don't show
<p>I have had django media images working in an existing django 1.7 project by adding the following to site urls.py:</p>

<pre><code>urlpatterns = patters(
    url(r'^media/(?P&lt;path&gt;.*)$', 'django.views.static.serve', {'document_root': settings.MEDIA_ROOT, 'show_indexes': True}),
)
</code></pre>

<p>This url structure doesn't work in django 1.10 and so I changed it to the reccommended here <a href="http://stackoverflow.com/questions/5517950/django-media-url-and-media-root">Django MEDIA_URL and MEDIA_ROOT</a>:</p>

<pre><code>urlpatterns = [

] + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
</code></pre>

<p><strong>This fails to render any uploaded media images.  Is there an equivalent media url patter for django 1.10 I can use?</strong></p>

<p>You can use this: 
(<a href="https://docs.djangoproject.com/en/1.10/howto/static-files/" rel="nofollow">Django docs 1.10 Serving files uploaded by a user during development</a>)</p>

<pre><code>urlpatterns = [
   ...
] + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
</code></pre>

<p>OR you can use this (if you only want it in development with the Debug = True in you'r settings): <a href="https://docs.djangoproject.com/en/1.10/ref/views/" rel="nofollow">Django docs 1.10 Serving files in development</a></p>

<pre><code>if settings.DEBUG:
    urlpatterns += [
        url(r'^media/(?P&lt;path&gt;.*)$', serve, {
            'document_root': settings.MEDIA_ROOT,
        }),
    ]
</code></pre>

<p>For me the <strong>{{ MEDIA_URL }}</strong> didn't work anymore in my template file, I used the <strong>{% get_media_prefix %}</strong>:</p>

<p>Ex.:  </p>

<pre><code>&lt;img src="{% get_media_prefix %}{{ product.image }}"&gt;
</code></pre>

python django django-staticfiles django-media django-1.10