[英]Django Move Project from Windows Host to Linux Host (and Deploy)
我正在嘗試將我的 Django 應用程序移動到真正的服務器(或將其部署在那里,自托管),但到目前為止,我嘗試過的所有內容除了顯示錯誤之外什么都不做。 我正在使用 SQLite 數據庫,因為該應用程序根本不會獲得太多流量。
例如:如果我嘗試在我的 Windows 機器上部署應用程序,我會遇到安全錯誤,他不會通過。
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,他也不會通過最后兩個安全檢查。 並且在調試 State False 中,網站甚至無法在我的 Windows 機器上正確加載...
即使是 Django 管理面板在這個 state 上看起來也很糟糕......
如果我嘗試在 Linux 服務器上運行run manage.py check --deploy
--deploy 我會得到完全相同的錯誤。
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).
這是最讓我困惑的地方。 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. 我完全不明白。
請幫我。 我為這個項目工作了一個月,但如果我不能部署它,那么整個事情都是徒勞的......
更多信息:
Windows 文件夾和設置.py
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.