mirror of
https://github.com/netbox-community/netbox.git
synced 2024-05-10 07:54:54 +00:00
Merge pull request #9415 from tyler-8/csrf_cookie_setting
Add optional CSRF_COOKIE_NAME setting, update example config, and docs.
This commit is contained in:
@ -66,6 +66,14 @@ CORS_ORIGIN_WHITELIST = [
|
|||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
|
## CSRF_COOKIE_NAME
|
||||||
|
|
||||||
|
Default: `csrftoken`
|
||||||
|
|
||||||
|
The name of the cookie to use for the CSRF authentication token. See the [Django documentation](https://docs.djangoproject.com/en/stable/ref/settings/#session-cookie-name) for more detail.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
## CSRF_TRUSTED_ORIGINS
|
## CSRF_TRUSTED_ORIGINS
|
||||||
|
|
||||||
Default: `[]`
|
Default: `[]`
|
||||||
|
@ -202,6 +202,9 @@ RQ_DEFAULT_TIMEOUT = 300
|
|||||||
# this setting is derived from the installed location.
|
# this setting is derived from the installed location.
|
||||||
# SCRIPTS_ROOT = '/opt/netbox/netbox/scripts'
|
# SCRIPTS_ROOT = '/opt/netbox/netbox/scripts'
|
||||||
|
|
||||||
|
# The name to use for the csrf token cookie.
|
||||||
|
CSRF_COOKIE_NAME = 'csrftoken'
|
||||||
|
|
||||||
# The name to use for the session cookie.
|
# The name to use for the session cookie.
|
||||||
SESSION_COOKIE_NAME = 'sessionid'
|
SESSION_COOKIE_NAME = 'sessionid'
|
||||||
|
|
||||||
|
@ -84,6 +84,7 @@ if BASE_PATH:
|
|||||||
CORS_ORIGIN_ALLOW_ALL = getattr(configuration, 'CORS_ORIGIN_ALLOW_ALL', False)
|
CORS_ORIGIN_ALLOW_ALL = getattr(configuration, 'CORS_ORIGIN_ALLOW_ALL', False)
|
||||||
CORS_ORIGIN_REGEX_WHITELIST = getattr(configuration, 'CORS_ORIGIN_REGEX_WHITELIST', [])
|
CORS_ORIGIN_REGEX_WHITELIST = getattr(configuration, 'CORS_ORIGIN_REGEX_WHITELIST', [])
|
||||||
CORS_ORIGIN_WHITELIST = getattr(configuration, 'CORS_ORIGIN_WHITELIST', [])
|
CORS_ORIGIN_WHITELIST = getattr(configuration, 'CORS_ORIGIN_WHITELIST', [])
|
||||||
|
CSRF_COOKIE_NAME = getattr(configuration, 'CSRF_COOKIE_NAME', 'csrftoken')
|
||||||
CSRF_TRUSTED_ORIGINS = getattr(configuration, 'CSRF_TRUSTED_ORIGINS', [])
|
CSRF_TRUSTED_ORIGINS = getattr(configuration, 'CSRF_TRUSTED_ORIGINS', [])
|
||||||
DATE_FORMAT = getattr(configuration, 'DATE_FORMAT', 'N j, Y')
|
DATE_FORMAT = getattr(configuration, 'DATE_FORMAT', 'N j, Y')
|
||||||
DATETIME_FORMAT = getattr(configuration, 'DATETIME_FORMAT', 'N j, Y g:i a')
|
DATETIME_FORMAT = getattr(configuration, 'DATETIME_FORMAT', 'N j, Y g:i a')
|
||||||
|
Reference in New Issue
Block a user