问题
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.
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).
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...
Even the Django Admin Panel looks awful at this state...
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).
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...
More Information:
Windows Folders and settings.py
回答1:
I found my Error. There where a blank in the Green Box.
来源:https://stackoverflow.com/questions/58972401/django-move-project-from-windows-host-to-linux-host-and-deploy