django中-TypeError: view must be a callable or a list/tuple in the case of include().

这个问题弄了好久:

    这个是django版本原因导致的错误:

    原来的配置

from django.conf import settings
    url(r'uploads/(?P.*)$',\
                'django.views.static.serve',\   
                {'document_root':settings.MEDIA_ROOT,})  

    更新后的配置

from django.views.static import serve
    url(r'^uploads/(?P.*)$',\
        serve,\
        {'document_root':settings.MEDIA_ROOT,})    

    这样才能运行! 

你可能感兴趣的:(Django)