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']
|
||||
key = check_ip(ipaddr)
|
||||
s[key] = ipaddr
|
||||
s[key+'_timestamp'] = now()
|
||||
s[key + '_timestamp'] = now()
|
||||
logger.debug("detected %s: %s" % (key, ipaddr))
|
||||
s.save()
|
||||
return HttpResponse(status=204)
|
||||
|
@ -247,7 +247,7 @@ def CsrfFailureView(request, reason):
|
||||
:return: HttpResponse object
|
||||
"""
|
||||
if reason == "CSRF cookie not set.":
|
||||
content ="""\
|
||||
content = """\
|
||||
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).
|
||||
|
@ -217,14 +217,14 @@ CSRF_FAILURE_VIEW = 'nsupdate.main.views.CsrfFailureView'
|
||||
CSRF_COOKIE_NAME = 'csrftoken'
|
||||
CSRF_COOKIE_PATH = '/'
|
||||
CSRF_COOKIE_SECURE = False
|
||||
SESSION_COOKIE_HTTPONLY = False
|
||||
CSRF_COOKIE_HTTPONLY = False
|
||||
|
||||
# Settings for session cookie.
|
||||
SESSION_COOKIE_NAME = 'sessionid'
|
||||
SESSION_COOKIE_PATH = '/'
|
||||
SESSION_COOKIE_SECURE = False
|
||||
SESSION_COOKIE_HTTPONLY = True
|
||||
SESSION_COOKIE_AGE = 14 * 24 * 3600 # 2 weeks, in seconds
|
||||
SESSION_COOKIE_AGE = 14 * 24 * 3600 # 2 weeks, in seconds
|
||||
SESSION_EXPIRE_AT_BROWSER_CLOSE = False
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user