python的django写页面上传文件以及遇到的问题
首先上结构
mynode -> app5 -> urls.py & views.py
| -> templates -> 5 -> upload.html
| -> mynode -> urls.py
| -> media
按照顺序,先上app5/urls.py
from django.urls import path
from app5 import views as v5
app_name = "app5"
urlpatterns = [
path("upload_file/", v5.upload_file, name = "upload_file"),
path("show_upload/", v5.show_upload, name = "show_upload"),
]