Read-only maintenance mode setting for config.py (#356)

Disables all POSTs, optionally allowing users to log in (without updating last login date)
Blocked POSTs will redirect to the GET endpoint if possible, otherwise to referrer or in last case, home page.
API requests will get a plaintext message with 405 status code.
This commit is contained in:
Anna-Maria Meriniemi
2017-09-05 01:16:52 +03:00
committed by Arylide
parent 5e93d7ec6d
commit c5d705210d
6 changed files with 61 additions and 8 deletions

View File

@@ -1,7 +1,13 @@
import os
DEBUG = True
# A read-only maintenance mode, in which the database is not modified
MAINTENANCE_MODE = True
# A maintenance message (used in layout.html template)
MAINTENANCE_MODE_MESSAGE = 'Site is currently in read-only maintenance mode.'
# Allow logging in during maintenance (without updating last login date)
MAINTENANCE_MODE_LOGINS = True
USE_RECAPTCHA = False
USE_EMAIL_VERIFICATION = False
USE_MYSQL = True