来自pip install --help:
--user Install to the Python user install directory for your platform. Typically ~/.local/, or %APPDATA%\Python on
Windows. (See the Python documentation for site.USER_BASE for full details.)
Run Code Online (Sandbox Code Playgroud)
site.USER_BASE的文档是一个令人讨厌的虫洞,有趣的*NIX主题,我不明白.
--user简明英语的目的是什么?为什么要将包裹装入~/.local/物质?为什么不在我的$ PATH中放置一个可执行文件?
上传 1-2mb 文件工作正常。当我尝试上传 16mb 文件时,几秒钟后出现 502 错误
更详细:
def upload(request):
if request.method == 'POST':
f = File(data=request.FILES['file'])
f.save()
return redirect(reverse(display), f.id)
else:
return render('filehosting_upload.html', request)
Run Code Online (Sandbox Code Playgroud)
render(template, request [,data]) 是我自己的速记,用于处理一些 ajax 内容;
的filehosting_upload.html:
{% extends "base.html" %}
{% block content %}
<h2>File upload</h2>
<form action="{% url nexus.filehosting.views.upload %}" method="post" enctype="multipart/form-data">
{% csrf_token %}
<input type="file" name="file">
<button type="submit" class="btn">Upload</button>
</form>
{% endblock %}
Run Code Online (Sandbox Code Playgroud)
我在日志中找不到任何信息。
版本: …