From 02bd5a564fdacd09bf7164d9d064b2305917c63d Mon Sep 17 00:00:00 2001 From: Fabio Caccamo Date: Wed, 22 Jun 2016 16:28:09 +0200 Subject: [PATCH] Updated README and LICENSE --- LICENSE.txt | 2 +- README.md | 21 ++++++++++++--------- 2 files changed, 13 insertions(+), 10 deletions(-) diff --git a/LICENSE.txt b/LICENSE.txt index 664d6c1..08c3cb0 100644 --- a/LICENSE.txt +++ b/LICENSE.txt @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2015 Fabio Caccamo - fabio.caccamo@gmail.com +Copyright (c) 2016 Fabio Caccamo - fabio.caccamo@gmail.com Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/README.md b/README.md index e5d5fa7..478e520 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,7 @@ It doesn't use database and doesn't prevent database access. ##Requirements - Python 2.6, Python 2.7 -- Django 1.5 through Django 1.8 +- Django 1.5 through Django 1.9 ##Installation @@ -45,6 +45,9 @@ MAINTENANCE_MODE_REDIRECT_URL = None #the template that will be shown by the maintenance-mode page MAINTENANCE_MODE_TEMPLATE = '503.html' + +#the path of the function that will return the template context -> 'myapp.mymodule.myfunction' +MAINTENANCE_MODE_TEMPLATE_CONTEXT = None ``` Add **maintenance_mode.urls** to ``urls.py`` if you want superusers able to set maintenance_mode using urls. @@ -74,22 +77,22 @@ from django.core.management.base import BaseCommand class Command(BaseCommand): - + def handle(self, *args, **options): - + call_command('maintenance_mode', 'on') - + #call your command(s) - + call_command('maintenance_mode', 'off') - - - + + + ``` ####Terminal -Run ``python manage.py maintenance_mode `` +Run ``python manage.py maintenance_mode `` *(****This is not Heroku-friendly because*** *any execution of heroku run `manage.py` will be run on a separate worker dyno, not the web one. Therefore* ***the state-file is set but on the wrong machine****)*