@@ -2,7 +2,7 @@ django-dev-protector
2
2
====================
3
3
The app for freelance developers, that blocks site if needed.
4
4
5
- It can be used in situations when a client don't want to pay your work. The app blocks all requests to the site and shows a template .
5
+ It can be used in situations when a client don't want to pay your work. The app blocks all requests to the site and shows a message of this situation .
6
6
7
7
Installation
8
8
------------
@@ -32,21 +32,28 @@ PROTECT_TEMPLATE_NAME = 'django_dev_protector/index.html'
32
32
33
33
# if redirect url is set, then default template would be
34
34
# redirects person after 10 sec
35
- PROTECT_REDIRECT_URL = None
35
+ PROTECT_REDIRECT_URL = 'http://your_client_opponent_site.com/'
36
36
```
37
37
By default server is unblocked
38
38
39
39
Usage
40
40
-----
41
- You must generate and save your hash first
41
+ You save your django SECRET_KEY from settings
42
42
```
43
- ./manage.py generatehash
43
+ SECRET_KEY = '...
44
44
```
45
- After you are able to block
45
+ After you are able to block or unblock site with POST requests
46
46
```
47
- http://127.0.0.1:8000/django_dev_protector/<hash>/on/
47
+ {
48
+ "key": <SECRET_KEY>,
49
+ "status": true
50
+ }
51
+ POST to http://<your_domain>/django_dev_protector/
52
+ ```
53
+ An example
54
+ ```
55
+ curl \
56
+ -H "Content-Type: application/json" \
57
+ -X POST -d '{"key": "<SECRET_KEY>", "status": true}' \
58
+ http://<your_domain>/django_dev_protector/
48
59
```
49
- or unblock site with GET requests
50
- ```
51
- http://127.0.0.1:8000/django_dev_protector/<hash>/off/
52
- ` ``
0 commit comments