我听说更改 XDG_CACHE_DIR 或 XDG_DATA_HOME 可以修复,但我做到了
export XDG_CACHE_DIR=<new path>
export XDG_DATA_HOME=<new path>
Run Code Online (Sandbox Code Playgroud)
我也试过
pip cache dir --cache-dir <new path>
Run Code Online (Sandbox Code Playgroud)
和
pip cache --cache-dir <new path>
Run Code Online (Sandbox Code Playgroud)
和
--cache-dir <new path>
Run Code Online (Sandbox Code Playgroud)
和
python --cache-dir <new path>
Run Code Online (Sandbox Code Playgroud)
来自https://pip.pypa.io/en/stable/reference/pip/#cmdoption-cache-dir
以及当我输入时
pip cache dir
Run Code Online (Sandbox Code Playgroud)
它仍然在旧位置。如何更改pip缓存的目录?
所以我在设置下设置了我的静态网址:
设置.py
STATIC_URL = '/static/'
if DEBUG or not DEBUG:
STATICFILES_DIRS = (
os.path.join(BASE_DIR, 'tabular', 'templates'),
os.path.join(BASE_DIR, 'common'),
)
Run Code Online (Sandbox Code Playgroud)
然后这是我的静态文件文件夹路径
我有一个带有 logo.png 和 step1.png-step4.png 的网页。由于一些奇怪的原因,当我在部署中运行时,它正确获取 logo.png,但不是 step1.png-step4.png。
这是html代码。
<div id="wrapper">
<div id="container">
<img style="padding: 1em;" src="{% static 'images/logo.png' %}" />
<form
class="form-horizontal"
enctype="multipart/form-data"
id="data_upload"
method="POST"
>
{% csrf_token %}
<div class="input-group mb-3">
<div class="custom-file">
<input
accept=".csv"
class="custom-file-input"
id="file_input"
name="file"
type="file"
/>
<label
aria-describedby="inputGroupFileAddon02"
class="custom-file-label"
for="inputGroupFile02"
id="submit_label"
>Upload CSV</label
>
</div>
<div class="input-group-append">
<button
class="input-group-text btn"
id="upload_button"
type="submit"
disabled
>
Upload …
Run Code Online (Sandbox Code Playgroud)