有一些弃用警告.这是问题所在:
RemovedInDjango110Warning: Support for string view arguments to url() is deprecated and will be removed in Django 1.10 (got django.views.static.serve). Pass the callable instead. 'document_root': settings.MEDIA_ROOT,
这是网址:
urlpatterns = [ url(r'^admin/', admin.site.urls), url(r'^ckeditor/', include('ckeditor_uploader.urls')), url(r'^media/(?P.*)$', 'django.views.static.serve', { 'document_root': settings.MEDIA_ROOT, }), url(r'^post/(\d+)$', post), url(r'^(\w+)$', category), url(r'^$', category), ]
怎么解决?谢谢你的时间.
用实际视图函数替换字符串中的函数路径.例如:
from django.views.static import serve ... url(r'^media/(?P.*)$', serve, { 'document_root': settings.MEDIA_ROOT, }),