我正在将我的第一个 Django 项目上传到 Linux 服务器,我应该将我的项目放在文件系统中吗?
对于 PHP 或 ASP 项目,所有内容都进入 /var/www
,是否可以这样做并将我的 Django 项目添加到 /var/www
文件夹?
最佳答案
在 Django tutorial它指出:
Where should this code live?
If your background is in PHP, you're probably used to putting code under the Web server's document root (in a place such as /var/www). With Django, you don't do that. It's not a good idea to put any of this Python code within your Web server's document root, because it risks the possibility that people may be able to view your code over the Web. That's not good for security.Put your code in some directory outside of the document root, such as /home/mycode.
关于python - 推荐一个 Django 项目在 Linux 上运行的地方,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13821959/