error configuring url while re-learning django configuration upload file
from django.conf.urls import url
from . import views
from django.conf import settings
from .upload import upload_image
urlpatterns = [
-sharp
url(r"^$", views.index, name="index"),
url(r"^uploads/(?P<path>.*)$", "django.views.static.serve", {"document_root": settings.MEDIA_ROOT, }),
url(r"^admin/upload/(?P<dir_name>[^/]+)$", upload_image, name="upload_image"),
]
the prompt message requires the format of list / tuple. No format error seems to be found, so ask for help. The django version is 1.11
. File "C:\Users\kuangcuisheng\Desktop\cytxt\bbnews\bbnews\***\urls.py", line 13, in <module>
url(r"^uploads/(?P<path>.*)$", "django.views.static.serve", {"document_root": settings.MEDIA_ROOT, }),
raise TypeError("view must be a callable or a list/tuple in the case of include().")
TypeError: view must be a callable or a list/tuple in the case of include().