Python django.conf.settings.CSRF_HEADER_NAME Examples
The following are 2
code examples of django.conf.settings.CSRF_HEADER_NAME().
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example.
You may also want to check out all available functions/classes of the module
django.conf.settings
, or try the search function
.
Example #1
Source File: tests.py From djongo with GNU Affero General Public License v3.0 | 5 votes |
def test_csrf_token_in_header_with_customized_name(self): """ settings.CSRF_HEADER_NAME can be used to customize the CSRF header name """ req = self._get_POST_csrf_cookie_request() req.META['HTTP_X_CSRFTOKEN_CUSTOMIZED'] = self._csrf_id self.mw.process_request(req) req2 = self.mw.process_view(req, post_form_view, (), {}) self.assertIsNone(req2)
Example #2
Source File: tests.py From djongo with GNU Affero General Public License v3.0 | 5 votes |
def test_csrf_token_in_header_with_customized_name(self): """ settings.CSRF_HEADER_NAME can be used to customize the CSRF header name """ req = self._get_POST_csrf_cookie_request() req.META['HTTP_X_CSRFTOKEN_CUSTOMIZED'] = self._csrf_id self.mw.process_request(req) req2 = self.mw.process_view(req, post_form_view, (), {}) self.assertIsNone(req2)