File tree Expand file tree Collapse file tree 1 file changed +10
-3
lines changed Expand file tree Collapse file tree 1 file changed +10
-3
lines changed Original file line number Diff line number Diff line change
1
+ from django .http import JsonResponse
2
+ from django .views import View
1
3
import requests
2
4
import subprocess
3
5
8
10
sessions .SessionRedirectMixin .resolve_redirects ()
9
11
session = requests .Session ()
10
12
proxies = {
11
- 'http' : 'http://test:pass@localhost:8080' ,
12
- 'https' : 'http://test:pass@localhost:8090' ,
13
+ 'http' : 'http://test:pass@localhost:8080' ,
14
+ 'https' : 'http://test:pass@localhost:8090' ,
13
15
}
14
16
url = 'http://example.com' # Replace with a valid URL
15
17
req = requests .Request ('GET' , url )
21
23
command = "ping " + user_input
22
24
subprocess .call (command , shell = True )
23
25
24
- print ("Command executed!" )
26
+ print ("Command executed!" )
27
+
28
+ class HealthView (View ):
29
+ def get (self , request , * args , ** kwargs ):
30
+ return JsonResponse ({'message' : 'ok' })
31
+
You can’t perform that action at this time.
0 commit comments