I’m facing this problem after I deploy my app to Kubernetes and after my project start it keep return “GET / HTTP/1.1” 301 0 I’ve tried to find the cause but still not found any of it. I’ve tried change DJANGO_SECURE_SSL_REDIRECT = False , SECURE_PROXY_SSL_HEADER = (“HTTP_X_FORWARDED_PROTO”, “https”), etc. are there any of you guys facing this problem?
production.py
# SECURITY
# ------------------------------------------------------------------------------
# https://docs.djangoproject.com/en/dev/ref/settings/#secure-proxy-ssl-header
SECURE_PROXY_SSL_HEADER = ("HTTP_X_FORWARDED_PROTO", "https")
# https://docs.djangoproject.com/en/dev/ref/settings/#secure-ssl-redirect
SECURE_SSL_REDIRECT = env.bool("DJANGO_SECURE_SSL_REDIRECT", default=False)
# https://docs.djangoproject.com/en/dev/ref/settings/#session-cookie-secure
SESSION_COOKIE_SECURE = False
# https://docs.djangoproject.com/en/dev/ref/settings/#csrf-cookie-secure
CSRF_COOKIE_SECURE = False
# https://docs.djangoproject.com/en/dev/topics/security/#ssl-https
# https://docs.djangoproject.com/en/dev/ref/settings/#secure-hsts-seconds
# TODO: set this to 60 seconds first and then to 518400 once you prove the former works
SECURE_HSTS_SECONDS = 60
# https://docs.djangoproject.com/en/dev/ref/settings/#secure-hsts-include-subdomains
SECURE_HSTS_INCLUDE_SUBDOMAINS = env.bool(
"DJANGO_SECURE_HSTS_INCLUDE_SUBDOMAINS",
default=True,
)
# https://docs.djangoproject.com/en/dev/ref/settings/#secure-hsts-preload
SECURE_HSTS_PRELOAD = env.bool("DJANGO_SECURE_HSTS_PRELOAD", default=True)
# https://docs.djangoproject.com/en/dev/ref/middleware/#x-content-type-options-nosniff
SECURE_CONTENT_TYPE_NOSNIFF = env.bool(
"DJANGO_SECURE_CONTENT_TYPE_NOSNIFF",
default=True,
)
CORS_ALLOW_ALL_ORIGINS = True
lib
python-slugify==8.0.4 # https://github.com/un33k/python-slugify
Pillow==10.2.0 # https://github.com/python-pillow/Pillow
argon2-cffi==23.1.0 # https://github.com/hynek/argon2_cffi
redis==5.0.3 # https://github.com/redis/redis-py
hiredis==2.3.2 # https://github.com/redis/hiredis-py
# Django
# ------------------------------------------------------------------------------
django==4.2.11 # pyup: < 5.0 # https://www.djangoproject.com/
django-environ==0.11.2 # https://github.com/joke2k/django-environ
django-model-utils==4.4.0 # https://github.com/jazzband/django-model-utils
django-allauth[mfa]==0.61.1 # https://github.com/pennersr/django-allauth
django-crispy-forms==2.1 # https://github.com/django-crispy-forms/django-crispy-forms
crispy-bootstrap5==2024.2 # https://github.com/django-crispy-forms/crispy-bootstrap5
django-redis==5.4.0 # https://github.com/jazzband/django-redis
# Django REST Framework
djangorestframework==3.14.0 # https://github.com/encode/django-rest-framework
django-cors-headers==4.3.1 # https://github.com/adamchainz/django-cors-headers
djangorestframework-simplejwt>=5.3.1,<5.4
# DRF-spectacular for api documentation
drf-spectacular==0.27.1 # https://github.com/tfranzel/drf-spectacular
# Live field
django-livefield==4.1.0
# Django Reversion
django-reversion==5.0.12 # https://github.com/etianen/django-reversion
# Django Guardian
# django-guardian==2.2.0
pandas==1.3.5
celery==5.3.6
django-celery-beat==2.6.0
# Slack Client
slackclient==2.5.0 # https://github.com/slackapi/python-slackclient
#Pika
pika==1.3.2
gunicorn==21.2.0 # https://github.com/benoitc/gunicorn
psycopg2-binary>=2.9.9,<2.10 # https://github.com/psycopg/psycopg
Collectfast==2.2.0 # https://github.com/antonagestam/collectfast
# Django
# ------------------------------------------------------------------------------
django-storages[s3]==1.14.2 # https://github.com/jschneier/django-storages
django-anymail[mailgun]==10.3 # https://github.com/anymail/django-anymail
django-debug-toolbar>=4.3.0 # https://github.com/jazzband/django-debug-toolbar
django-extensions==3.2.3 # https://github.com/django-extensions/django-extensions
django-coverage-plugin>=3.1.0 # https://github.com/nedbat/django_coverage_plugin
pytest-django>=4.8.0 # https://github.com/pytest-dev/pytest-django