python - 数字海洋中的 Django
问题描述
随着 django 在数字海洋上运行,我如何下载亚马逊网络服务上的文件然后进行操作。是否有 / temp 文件夹或其他东西,可以释放该访问权限以进行操作?
解决方案
The standard directory for temporary files on Unix-based systems is /tmp
. From man hier
:
/tmp This directory contains temporary files which may be deleted with no notice, such as by a regular job or at system boot up.
Your Django app can freely read and write files to the /tmp
directory. However, I highly recommend using Python's builtin tempfile
module to take care of the details for you.
推荐阅读
- python-3.x - 在多处理嵌套循环和字典中面临问题
- php - 在 Braintree 中创建子商家账户会出现“主商家账户 ID 无效”错误
- java - 是否可以在 Java 中使用 Mockito 模拟语句?
- python - 如何在文件中添加引号
- regex - regex ~ delimited string 在看到 ~~ 并跳过一列时变得混乱
- r - 如何在 ggerrorplot 中包含 x 值之间的不等距离?
- azure-devops - 我可以将代码从 Azure devops 推送到 Azure VM 吗?
- pyspark - 在 Azure Databricks 中使用 spark 流将数据加载到 azure blob
- excel - 将表格粘贴到电子邮件中时出现运行时错误 4605
- javascript - React App 在两个地方使用相同的函数,但 API 调用不同。我如何强制它每次都使用root?