在Django中加载用户上载的图像时出现问题

在Django中加载用户上载的图像时出现问题,django,django-media,django-mediagenerator,Django,Django Media,Django Mediagenerator,我的URL.py urlpatterns = patterns('', # Examples: # url(r'^$', 'photo.views.home', name='home'), # url(r'^photo/', include('photo.foo.urls')), # Uncomment the admin/doc line below to enable admin documentation: url(r'^admin/doc/', include('django.con

我的URL.py

urlpatterns = patterns('',
# Examples:
# url(r'^$', 'photo.views.home', name='home'),
# url(r'^photo/', include('photo.foo.urls')),

# Uncomment the admin/doc line below to enable admin documentation:
 url(r'^admin/doc/', include('django.contrib.admindocs.urls')),

# Uncomment the next line to enable the admin:
 url(r'^admin/', include(admin.site.urls)),
)

当我尝试访问用户上传的图像时,它会给我以下错误

Using the URLconf defined in photo.urls, Django tried these URL patterns, in this order:

^admin/doc/
^admin/
media/(?P<path>.*)$

The current URL, images/about-landscapes-nature.jpg, didn't match any of these.

我不确定这是否能解决您的所有问题,但
MEDIA\u URL
需要一个尾随斜杠,因此应该是:

MEDIA_URL = '/media/'

我在这个URL中尝试了@micahWoah。。。!!!这实际上解决了我的问题。这么愚蠢的错误。。。谢谢@整形加速器
Using the URLconf defined in photo.urls, Django tried these URL patterns, in this order:

^admin/doc/
^admin/
media/(?P<path>.*)$

The current URL, images/about-landscapes-nature.jpg, didn't match any of these.
photo
    media
    photoapp
        models.py
    settings.py
    urls.py
MEDIA_URL = '/media/'