fix typo in CSRF setting, fix pep8 issues
This commit is contained in:
parent
7cbacedaf1
commit
60f03b0472
@ -50,7 +50,7 @@ def DetectIpView(request, secret=None):
|
|||||||
ipaddr = request.META['REMOTE_ADDR']
|
ipaddr = request.META['REMOTE_ADDR']
|
||||||
key = check_ip(ipaddr)
|
key = check_ip(ipaddr)
|
||||||
s[key] = ipaddr
|
s[key] = ipaddr
|
||||||
s[key+'_timestamp'] = now()
|
s[key + '_timestamp'] = now()
|
||||||
logger.debug("detected %s: %s" % (key, ipaddr))
|
logger.debug("detected %s: %s" % (key, ipaddr))
|
||||||
s.save()
|
s.save()
|
||||||
return HttpResponse(status=204)
|
return HttpResponse(status=204)
|
||||||
|
@ -247,7 +247,7 @@ def CsrfFailureView(request, reason):
|
|||||||
:return: HttpResponse object
|
:return: HttpResponse object
|
||||||
"""
|
"""
|
||||||
if reason == "CSRF cookie not set.":
|
if reason == "CSRF cookie not set.":
|
||||||
content ="""\
|
content = """\
|
||||||
This site needs cookies (for CSRF protection, for keeping your session after login).
|
This site needs cookies (for CSRF protection, for keeping your session after login).
|
||||||
|
|
||||||
Please enable cookies in your browser (or otherwise make sure the CSRF cookie can be set).
|
Please enable cookies in your browser (or otherwise make sure the CSRF cookie can be set).
|
||||||
|
@ -217,7 +217,7 @@ CSRF_FAILURE_VIEW = 'nsupdate.main.views.CsrfFailureView'
|
|||||||
CSRF_COOKIE_NAME = 'csrftoken'
|
CSRF_COOKIE_NAME = 'csrftoken'
|
||||||
CSRF_COOKIE_PATH = '/'
|
CSRF_COOKIE_PATH = '/'
|
||||||
CSRF_COOKIE_SECURE = False
|
CSRF_COOKIE_SECURE = False
|
||||||
SESSION_COOKIE_HTTPONLY = False
|
CSRF_COOKIE_HTTPONLY = False
|
||||||
|
|
||||||
# Settings for session cookie.
|
# Settings for session cookie.
|
||||||
SESSION_COOKIE_NAME = 'sessionid'
|
SESSION_COOKIE_NAME = 'sessionid'
|
||||||
|
Loading…
x
Reference in New Issue
Block a user