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
13import requests
24import subprocess
35
810 sessions .SessionRedirectMixin .resolve_redirects ()
911 session = requests .Session ()
1012 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' ,
1315 }
1416 url = 'http://example.com' # Replace with a valid URL
1517 req = requests .Request ('GET' , url )
2123 command = "ping " + user_input
2224 subprocess .call (command , shell = True )
2325
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