Skip to content

Commit

Permalink
Updated README and LICENSE
Browse files Browse the repository at this point in the history
  • Loading branch information
fabiocaccamo committed Jun 22, 2016
1 parent cc9d8f0 commit 02bd5a5
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 10 deletions.
2 changes: 1 addition & 1 deletion 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
Expand Down
21 changes: 12 additions & 9 deletions README.md
Expand Up @@ -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

Expand Down Expand Up @@ -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.

Expand Down Expand Up @@ -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 <on|off>``
Run ``python manage.py maintenance_mode <on|off>``

*(****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****)*

Expand Down

0 comments on commit 02bd5a5

Please sign in to comment.