简体   繁体   English

我可以在 Django 的生产服务器上提供媒体文件吗?

[英]Can i serve media files on production server in Django?

Actually I created a fully functional web app using Django.实际上,我使用 Django 创建了一个功能齐全的 web 应用程序。 I don't have much experience to host a Django web app on a production server.我没有太多经验在生产服务器上托管 Django web 应用程序。 But I'm trying.但我正在努力。 My problem is that I read from a blog that we can't serve media files using Django.我的问题是我从博客中读到我们无法使用 Django 提供媒体文件。 We need Amazon S3 server to serve media files to Django.我们需要 Amazon S3 服务器为 Django 提供媒体文件。 I'm trying to host my Django app on digital ocean with apache server.我正在尝试使用 apache 服务器在数字海洋上托管我的 Django 应用程序。 Is there any way that I can serve media files using Django in production server.有什么方法可以在生产服务器中使用 Django 提供媒体文件。 Even I don't have a huge budget to buy a space on Amazon S3.即使我没有巨额预算在 Amazon S3 上购买空间。 What should I do?我应该怎么办?

You may try the open-source self-hosted S3 implementation - Minio .您可以尝试开源自托管 S3 实现 - Minio

Another approach is to serve static files using web-server.另一种方法是使用网络服务器提供 static 文件。 There is example with nginx.有 nginx 的例子

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM