How to fix "You're accessing the development server over HTTPS, but it only supports HTTP." in Django?
SECURE_CONTENT_TYPE_NOSNIFF = True
SECURE_BROWSER_XSS_FILTER = True
SESSION_COOKIE_SECURE = True
CSRF_COOKIE_SECURE = True
SECURE_SSL_REDIRECT = True
SECURE_PROXY_SSL_HEADER = ('HTTP_X_FORWARDED_PROTO', 'https')
CSRF_TRUSTED_ORIGINS = ['yoursite.com']
DEBUG = True
Clear the Django site's(what you developed) cookies and sessions on the browser. For Google Chrome, steps are below.
Settings
-> Privacy and Security
-> Cookies and other site data
-> See all cookies and site data
-> Search your site name or IP and click 'Trash' icon.
Sure
The below stack does not work locally.
I used Linode to deploy the app - they give a couple of months to try it for free. I created a Linode for Django with Linux
I had a temporary domain on azure.com
with open('key.txt') as f: SECRET_KEY = f.read().strip()
source: https://realpython.com/django-nginx-gunicorn/
ps -ef; kill XXXXX
. where XXXXX - number of the process, which often looks like 192.168.111.111:80000 (IP is an example)gunicorn -c config/gunicorn/prod.py
sources: https://letsencrypt.org/getting-started/, https://certbot.eff.org/
apt update; apt install nginx
include /etc/nginx/sites-enabled/*;
service nginx configtest /etc/nginx/sites-available/dev.my_domain.azure.com
snap install --classic certbot
certbot --nginx