【发布时间】:2022-01-04 09:13:02
【问题描述】:
这是我的 main.py
from flask import Flask, render_template
from oauth import Oauth
app = Flask(__name__, template_folder='template')
@app.route("/")
def home():
return render_template("index.html",discord_url=Oauth.discord_login_url)
@app.route("/login")
def login():
return "Success"
if __name__ == "__main__":
app.run(debug=True)
我的 index.html
<html>
<head>
<title>Home Page</title>
</head>
<body>
<h1>Welcome to Hexon X dashboard!</h1>
Click here to login:
<a href="{{discord_url}}"><button>Login with discord</button></a>
</body>
</html>
我的 oauth.py
class Oauth:
client_id = "Secret"
client_secret = "Secret "
redirect_uri = "https://127.0.0.1:5000/login"
scope = "identify%20email%20guilds"
discord_login_url = "secret too"
discord_token_url = "https://discord.com/api/oauth2/token"
discord_api_url = "https://discord.com/api"
给我这个错误
127.0.0.1 sent an invalid response
有人可以帮我吗 返回网址无效 并且重定向后不返回成功
【问题讨论】:
标签: python html flask localhost host