首页 > 解决方案 > 数字海洋中的 Django

问题描述

随着 django 在数字海洋上运行,我如何下载亚马逊网络服务上的文件然后进行操作。是否有 / temp 文件夹或其他东西,可以释放该访问权限以进行操作?

标签: pythondjangodigital-ocean

解决方案


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.


推荐阅读