(Apr-02-2021, 10:41 PM)vj78 Wrote: Yes, I am not using any frameworks. I have 3 different pages. 1)Login Page 2)Check.py 3)Sucess.htmlYou should use a Framework like a simpler one like Flask to avoid doing a lot of unnecessary stuff to fit stuff together.
In the older day CGI(dead now) was a thing,but after WSGI that now all Framework is build on top on.
So do not use use WSGI directly as Framework like Flask, FastAPI is layer above and has done all the undelaying stuff.
Could use Requests.
import requests response = requests.get('http://github.com/', allow_redirects=False) print(response.status_code) # 301 redirect is a permanent redirect response.url # http://github.com, not https so redirect dest = response.headers['Location'] # https://github.com/ -- the redirect destination print(dest)
Output:301
https://github.com
But Form and redirect all of this and more is build in a light Framework like eg Flask. from flask import Flask, redirect app = Flask(__name__) @app.route('/') def page(): return redirect('http://github.com/', code=301) if __name__ == "__main__": app.run()