fix typo in CSRF setting, fix pep8 issues

This commit is contained in:
Thomas Waldmann 2013-11-01 04:22:53 +01:00
parent 7cbacedaf1
commit 60f03b0472
3 changed files with 4 additions and 4 deletions

View File

@ -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)

View File

@ -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).

View File

@ -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