我想在 django 开发项目中下载一个文件,但出现错误...
视图.py:
from django.core.servers.basehttp import FileWrapper
def download_track(request, zone_id, wId):
if request.method=='POST':
form = DownloadedTrackForm(request.POST)
if form.is_valid():
path_to_file = '/var/www/tottrack/media/tracks/downloadedTracks/marc0.gpx'
views.serve(request, path_to_file)
错误:
'/var/www/tottrack/media/tracks/downloadedTracks/marc0.gpx' could not be found
该文件存在于该文件夹中...
任何想法??谢谢!!