File tree Expand file tree Collapse file tree 7 files changed +22
-22
lines changed
docs/integration/settings Expand file tree Collapse file tree 7 files changed +22
-22
lines changed Original file line number Diff line number Diff line change @@ -53,9 +53,9 @@ following keys:
53
53
- ` OPTIONS ` - a dictionary for additional settings
54
54
- ` VPN ` - use VPN detection and forbid access to VPN users
55
55
- ` URL ` - set of URLs to redirect to when the user is located in a forbidden country or using a VPN
56
- - ` FORBIDDEN_LOC ` - the URL to redirect to when the user is located in a forbidden country
57
- - ` FORBIDDEN_VPN ` - the URL to redirect to when the user is using a VPN
58
- - ` FORBIDDEN_KIT ` - the URL to redirect to when the user is using a forbidden device
56
+ - ` FORBIDDEN_LOC ` - the URL to redirect to when the user is located in a forbidden geolocation
57
+ - ` FORBIDDEN_NET ` - the URL to redirect to when the user is using a forbidden network ( VPN)
58
+ - ` FORBIDDEN_DEV ` - the URL to redirect to when the user is using a forbidden device
59
59
60
60
The available device types are: ` smartphone ` , ` peripheral ` - refers to all hardware components that are attached to a
61
61
computer, ` wearable ` - common types of wearable technology include smartwatches and smartglasses, ` phablet ` - a
@@ -72,8 +72,8 @@ DJANGO_FORBID = {
72
72
' VPN' : True ,
73
73
' URL' : {
74
74
' FORBIDDEN_LOC' : ' forbidden_location' ,
75
- ' FORBIDDEN_VPN ' : ' forbidden_network' ,
76
- ' FORBIDDEN_KIT ' : ' forbidden_device' ,
75
+ ' FORBIDDEN_NET ' : ' forbidden_network' ,
76
+ ' FORBIDDEN_DEV ' : ' forbidden_device' ,
77
77
},
78
78
},
79
79
}
Original file line number Diff line number Diff line change @@ -12,9 +12,9 @@ following keys.
12
12
- ` OPTIONS ` - a dictionary for additional settings
13
13
- ` VPN ` - use VPN detection and forbid access to VPN users
14
14
- ` URL ` - set of URLs to redirect to when the user is located in a forbidden country or using a VPN
15
- - ` FORBIDDEN_LOC ` - the URL to redirect to when the user is located in a forbidden country
16
- - ` FORBIDDEN_VPN ` - the URL to redirect to when the user is using a VPN
17
- - ` FORBIDDEN_KIT ` - the URL to redirect to when the user is using a forbidden device
15
+ - ` FORBIDDEN_LOC ` - the URL to redirect to when the user is located in a forbidden geolocation
16
+ - ` FORBIDDEN_NET ` - the URL to redirect to when the user is using a forbidden network ( VPN)
17
+ - ` FORBIDDEN_DEV ` - the URL to redirect to when the user is using a forbidden device
18
18
19
19
These variables are all covered in more detail at the [ next page] ( ./variables.md ) .
20
20
@@ -32,8 +32,8 @@ DJANGO_FORBID = {
32
32
' VPN' : True ,
33
33
' URL' : {
34
34
' FORBIDDEN_LOC' : ' forbidden_location' ,
35
- ' FORBIDDEN_VPN ' : ' forbidden_network' ,
36
- ' FORBIDDEN_KIT ' : ' forbidden_device' ,
35
+ ' FORBIDDEN_NET ' : ' forbidden_network' ,
36
+ ' FORBIDDEN_DEV ' : ' forbidden_device' ,
37
37
},
38
38
},
39
39
}
Original file line number Diff line number Diff line change @@ -100,16 +100,16 @@ the default Django 403 page. The URL can be absolute or relative.
100
100
101
101
#### Forbidden Network
102
102
103
- - Key: ` FORBIDDEN_VPN `
103
+ - Key: ` FORBIDDEN_NET `
104
104
- Type: ` str `
105
105
- Default: ` '' `
106
106
107
- This URL is used when the user is using a virtual private network (VPN). If not specified, the user will see the default
108
- Django 403 page. The URL can be absolute or relative.
107
+ This URL is used when the user is using a virtual private network (VPN) while VPN detection is enabled. If not
108
+ specified, the user will see the default Django 403 page. The URL can be absolute or relative.
109
109
110
110
#### Forbidden Device
111
111
112
- - Key: ` FORBIDDEN_KIT `
112
+ - Key: ` FORBIDDEN_DEV `
113
113
- Type: ` str `
114
114
- Default: ` '' `
115
115
Original file line number Diff line number Diff line change @@ -30,7 +30,7 @@ license_file = LICENSE
30
30
platforms = unix, linux, osx, win32
31
31
classifiers =
32
32
Operating System :: OS Independent
33
- Development Status :: 4 - Beta
33
+ Development Status :: 5 - Production/Stable
34
34
Framework :: Django
35
35
Framework :: Django :: 2.1
36
36
Framework :: Django :: 2.2
Original file line number Diff line number Diff line change 1
- __version__ = "0.0.9 "
1
+ __version__ = "0.1.0 "
Original file line number Diff line number Diff line change @@ -39,8 +39,8 @@ def __call__(self, request):
39
39
if Access (devices ).grants (device_type ):
40
40
return self .get_response (request )
41
41
42
- # Redirects to the FORBIDDEN_KIT URL if set.
43
- if Settings .has ("OPTIONS.URL.FORBIDDEN_KIT " ):
44
- return redirect (Settings .get ("OPTIONS.URL.FORBIDDEN_KIT " ))
42
+ # Redirects to the FORBIDDEN_DEV URL if set.
43
+ if Settings .has ("OPTIONS.URL.FORBIDDEN_DEV " ):
44
+ return redirect (Settings .get ("OPTIONS.URL.FORBIDDEN_DEV " ))
45
45
46
46
return HttpResponseForbidden ()
Original file line number Diff line number Diff line change @@ -42,9 +42,9 @@ def erase_response_attributes():
42
42
43
43
if geoip2_tz != "N/A" and client_tz != geoip2_tz :
44
44
erase_response_attributes ()
45
- # Redirects to the FORBIDDEN_VPN URL if set.
46
- if Settings .has ("OPTIONS.URL.FORBIDDEN_VPN " ):
47
- return redirect (Settings .get ("OPTIONS.URL.FORBIDDEN_VPN " ))
45
+ # Redirects to the FORBIDDEN_NET URL if set.
46
+ if Settings .has ("OPTIONS.URL.FORBIDDEN_NET " ):
47
+ return redirect (Settings .get ("OPTIONS.URL.FORBIDDEN_NET " ))
48
48
return HttpResponseForbidden ()
49
49
50
50
# Restores the response from the session.
You can’t perform that action at this time.
0 commit comments