This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
from django.contrib.auth.decorators import login_required | |
from django.utils.cache import patch_response_headers | |
from django.utils.decorators import method_decorator | |
from django.views.decorators.cache import cache_page, never_cache | |
from django.views.decorators.csrf import csrf_exempt | |
class NeverCacheMixin(object): | |
@method_decorator(never_cache) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
try: | |
from django.utils.deprecation import MiddlewareMixin | |
except ImportError: | |
MiddlewareMixin = object | |
class ForceDefaultLanguageMiddleware(MiddlewareMixin): | |
""" | |
Ignore Accept-Language HTTP headers | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Tracing route to FIN [216.81.59.173]: | |
1 76 ms 96 ms 99 ms 192.168.1.254 | |
2 * * * Request timed out. | |
3 18 ms 18 ms 17 ms 195.66.225.189 | |
4 22 ms 24 ms 24 ms 10gigabitethernet1-1.core1.lon1.he.net [195.66.224.21] | |
5 24 ms 24 ms 24 ms 10gigabitethernet2-4.core1.par2.he.net [72.52.92.42] | |
6 97 ms 97 ms 100 ms 10gigabitethernet7-1.core1.ash1.he.net [184.105.213.93] | |
7 109 ms 109 ms 112 ms 10gigabitethernet1-2.core1.atl1.he.net [184.105.213.110] | |
8 109 ms 108 ms 108 ms 216.66.0.26 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//query | |
$.ajax({ | |
data: 'csrfmiddlewaretoken={{ csrf_token }}&..., | |
type: 'post', | |
}); | |
//json | |
$.ajax({ | |
data: {'csrfmiddlewaretoken': '{{ csrf_token }}', ...}, |