Expose CSRF_TRUSTED_ORIGINS as a configuration parameter #6031

Closed
opened 2025-12-29 19:35:54 +01:00 by adam · 0 comments
Owner

Originally created by @jeremystretch on GitHub (Feb 1, 2022).

Originally assigned to: @jeremystretch on GitHub.

NetBox version

v3.1.6

Feature type

New functionality

Proposed functionality

Expose Django's CSRF_TRUSTED_ORIGINS setting as a parameter that can be defined in configuration.py.

Use case

Currently, this setting is populated with the same hostnames defined in ALLOWED_HOSTS. However, Django 4.0 requires that each entry in CSRF_TRUSTED_ORIGINS now specify a scheme (e.g. http:// or https://) as well. To accommodate this change while also providing a greater degree of flexibility to the user, we can expose CSRF_TRUSTED_ORIGINS directly.

Database changes

No response

External dependencies

No response

Originally created by @jeremystretch on GitHub (Feb 1, 2022). Originally assigned to: @jeremystretch on GitHub. ### NetBox version v3.1.6 ### Feature type New functionality ### Proposed functionality Expose Django's [`CSRF_TRUSTED_ORIGINS`](https://docs.djangoproject.com/en/stable/ref/settings/#std:setting-CSRF_TRUSTED_ORIGINS) setting as a parameter that can be defined in `configuration.py`. ### Use case Currently, this setting is populated with the same hostnames defined in [`ALLOWED_HOSTS`](https://docs.djangoproject.com/en/stable/ref/settings/#std:setting-ALLOWED_HOSTS). However, Django 4.0 requires that each entry in `CSRF_TRUSTED_ORIGINS` now specify a scheme (e.g. `http://` or `https://`) as well. To accommodate this change while also providing a greater degree of flexibility to the user, we can expose `CSRF_TRUSTED_ORIGINS` directly. ### Database changes _No response_ ### External dependencies _No response_
adam added the status: acceptedtype: feature labels 2025-12-29 19:35:54 +01:00
adam closed this issue 2025-12-29 19:35:54 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#6031