Django将项目从Windows主机移至Linux主机(和部署) [英] Django Move Project from Windows Host to Linux Host (and Deploy)

查看:128
本文介绍了Django将项目从Windows主机移至Linux主机(和部署)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试将Django应用程序移动到真实服务器(或将其部署到自托管的服务器上),但到目前为止,我尝试过的所有操作除了显示错误外都没有执行任何操作.我正在使用SQLite数据库,因为该应用程序根本不会获得太多流量.

I'm trying to Move my Django App to a real Server (or deploy it there, self-hosted) but everything, I have tried so far, does nothing except displaying errors. I'm using the SQLite database because the app won't get much traffic at all.

例如:如果我尝试在Windows计算机上部署该应用程序,我会收到安全性错误,他将无法通过.

For Example: If I try to deploy the app on my Windows machine I get security errors he won't pass.

py -3 manage.py check --deploy
System check identified some issues:

WARNINGS:
?: (security.W004) You have not set a value for the SECURE_HSTS_SECONDS setting. If your entire site is served only over SSL, you may want to consider setting a value and enabling HTTP Strict Transport Security. Be sure to read the documentation first; enabling HSTS
 carelessly can cause serious, irreversible problems.
?: (security.W008) Your SECURE_SSL_REDIRECT setting is not set to True. Unless your site should be available over both SSL and non-SS
L connections, you may want to either set this setting True or configure a load balancer or reverse-proxy server to redirect all connections to HTTPS.
?: (security.W018) You should not have DEBUG set to True in deployment.

System check identified 3 issues (0 silenced).

即使我将Debug设置为False,他也不会通过最后两次安全检查.并且在Debug状态为False的情况下,该网站甚至无法在我的Windows计算机上正确加载...

Even if I set Debug to False he won't pass the last two Security Checks. AND in Debug State False the Website even does not load correctly on my Windows machine...

即使在这种状态下,Django管理面板也看起来很糟糕...

Even the Django Admin Panel looks awful at this state...

如果我尝试在Linux服务器上运行 run manage.py check --deploy ,则会得到完全相同的错误.

If I try to run run manage.py check --deploy on the Linux server I get the exact same errors.

python3 Onboarding-Django/onboarding/manage.py check --deploy
System check identified some issues:

WARNINGS:
?: (security.W004) You have not set a value for the SECURE_HSTS_SECONDS setting. If your entire site is served only over SSL, you may want to consider setting a value and enabling HTTP Strict Transport Security. Be sure to read the documentation first; enabling HSTS carelessly can cause serious, irreversible problems.
?: (security.W008) Your SECURE_SSL_REDIRECT setting is not set to True. Unless your site should be available over both SSL and non-SSL connections, you may want to either set this setting True or configure a load balancer or reverse-proxy server to redirect all connections to HTTPS.
?: (security.W018) You should not have DEBUG set to True in deployment.

System check identified 3 issues (0 silenced).

这是让我最困惑的地方.我已经修改了settings.py静态根,等等,并且Django告诉我他缺少肯定存在的Base_generic.html模板,并且Django可以访问它.我一点都不明白.

And here is what confuses me the most. I've already adapted the settings.py Static Root and so on AND Django tells me that he is missing the Base_generic.html Template that is definitely there AND Django HAS Access to It. I don't get it at all.

请帮助我.我为这个项目工作了一个月,但如果我不能部署它,那么整个事情将一无是处...

Please help me. I worked month for this Project but if I can't deploy it the whole thing was for nothing...

更多信息:

Windows文件夹和settings.py

Windows Folders and settings.py

推荐答案

我发现了我的错误.那里在绿色框的空白处.

I found my Error. There where a blank in the Green Box.

这篇关于Django将项目从Windows主机移至Linux主机(和部署)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆