How can i use django to create a search field that will be able to perform a request from another website and render back some information from the site. for example if i submit this form number (PGA1512194112) on the search field, the app will be able to go to https://mis.unijos.edu.ng/pg/admissions/, search for PGA1512194112 and return back PGA1512194112's fullname, form number, faculty, department, programme and session.
Example(this is not a demo) of the view
def form(request):
query = request.GET.get['q']
if query is valid
return HttpResponseRedirect(form2)
else
search page
context = {'query': query}
return render(request,'.html', context)
Note: I dont even have idea of how the format of the view will look like.
' def form(request):
if request.GET:
url = 'URL'
query = request.GET.get('q')
resp = requests.post(url, data=query)
print ('resp.content')
else:
query=''
context = {'query': query, 'resp': resp}
return render(request, 'library/terms.html', context)'