gpt4 book ai didi

python - 推荐一个 Django 项目在 Linux 上运行的地方

转载 作者:IT老高 更新时间:2023-10-28 20:53:19 25 4
gpt4 key购买 nike

我正在将我的第一个 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/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com