static()
static.
static
(prefix, view=django.views.static.serve, **kwargs)¶
用于返回在调试模式下服务文件的 URL 模式的辅助函数:
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)