We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 9e553e4 commit fdf4fccCopy full SHA for fdf4fcc
1 file changed
main.py
@@ -1,3 +1,5 @@
1
+from django.http import JsonResponse
2
+from django.views import View
3
import requests
4
import subprocess
5
@@ -8,8 +10,8 @@
8
10
sessions.SessionRedirectMixin.resolve_redirects()
9
11
session = requests.Session()
12
proxies = {
- 'http': 'http://test:pass@localhost:8080',
- 'https': 'http://test:pass@localhost:8090',
13
+ 'http': 'http://test:pass@localhost:8080',
14
+ 'https': 'http://test:pass@localhost:8090',
15
}
16
url = 'http://example.com' # Replace with a valid URL
17
req = requests.Request('GET', url)
@@ -21,4 +23,9 @@
21
23
command = "ping " + user_input
22
24
subprocess.call(command, shell=True)
25
- 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
0 commit comments