简体   繁体   English

静态文件存储和服务器托管 - Django

[英]Static file storage and server hosting - Django

I am new to server side operations and have a personal project that I am building. 我是服务器端操作的新手,并且正在构建一个个人项目。 I am running Python3, Django2 with mysql (which will be changed to postgres for live usage) and currently have my static files stored inside the virtualenv on my local drive. 我正在运行带有MySQL的Python3,Django2(将其更改为Postgres以进行实时使用),当前将我的静态文件存储在本地驱动器的virtualenv中。 It's also built locally on Ubuntu 16.04 if this changes anything, for example: Maybe git deployment would be easiest? 它也是在Ubuntu 16.04本地构建的,如果这会改变任何东西,例如:也许git部署最简单?

My first question is : I don't expect lot's of traffic (under 1000 a day), and databases are very simple. 我的第一个问题是 :我不期望很多流量(每天1000个以下),数据库非常简单。 Only an admin can upload static content, such as posts, images, tags and categories. 只有管​​理员才能上传静态内容,例如帖子,图片,标签和类别。 Essentially a blog format. 本质上是一种博客格式。 Where should I store these files? 我应该在哪里存储这些文件? Amazon s3, azure, google, or anything you suggest 亚马逊s3,天蓝色,谷歌或任何你建议的东西

2. Second question is: Where should I host my web app, and how will it affect where I store my static files? 2.第二个问题是:我应该在哪里托管我的网络应用程序,它将如何影响我存储静态文件的位置?

I'd like to note that I am an entrepreneur doing this on my own so an inexpensive and simple setup is what I am aiming for as I don't have much experience in server side tech, but willing to learn. 我想指出的是,我是一个自己做事的企业家,因此,我的目标是廉价和简单的设置,因为我在服务器端技术方面没有太多经验,但愿意学习。

Thank you in advance for your time and sorry if I left out some required information, I'll update the Q as needed. 如果我遗漏了一些必要的信息,请提前感谢您的时间和抱歉,我会根据需要更新Q.

  1. We store our static files on s3 using s3utils . 我们使用s3utils将静态文件存储在s3上。 You should also check out the this post , it describes how to set up an S3 bucket with the proper permissions. 您还应该查看这篇文章 ,它描述了如何设置具有适当权限的S3存储桶。

  2. We host our webapps on AWS Ec2 with Nginx and Gunicorn. 我们使用Nginx和Gunicorn将Webapp托管在AWS Ec2上。 Check out How To Set Up Django with Postgres, Nginx, and Gunicorn on Ubuntu 16.04 了解如何在Ubuntu 16.04上使用Postgres,Nginx和Gunicorn设置Django

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

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