Title:
Implement Dynamic IP Handling for ALLOWED_HOSTS and CSRF_TRUSTED_ORIGINS
Description:
Update the configuration to allow automatic population of the server's IP address in the ALLOWED_HOSTS and CSRF_TRUSTED_ORIGINS settings in settings.py. This change is needed to support environments where the server's IP address may change due to DHCP assignment. The goal is to automate this process, reducing the need for manual updates when the IP address changes.
Acceptance Criteria:
Retrieve the server's current IP address during application startup.
Populate ALLOWED_HOSTS and CSRF_TRUSTED_ORIGINS with the correct IP address.
Maintain the security and functionality of the application after these changes.
Test in environments with dynamic IP assignments to confirm reliability.
Title: Implement Dynamic IP Handling for ALLOWED_HOSTS and CSRF_TRUSTED_ORIGINS
Description: Update the configuration to allow automatic population of the server's IP address in the
ALLOWED_HOSTS
andCSRF_TRUSTED_ORIGINS
settings insettings.py
. This change is needed to support environments where the server's IP address may change due to DHCP assignment. The goal is to automate this process, reducing the need for manual updates when the IP address changes.Acceptance Criteria:
ALLOWED_HOSTS
andCSRF_TRUSTED_ORIGINS
with the correct IP address.