Forums

Flask python3.10 the func not working in pythonanywhere

Flask python3.10 the func not working the code:

from flask import Flask, redirect

def wariter():
  with open("Watched.py","w")as f:
    f.write("Watched = True") 
app = Flask(__name__)

@app.route('/')
def index():
  wariter()
  return redirect("https://t.me/FUGA1_BOT")

if __name__ == '__name__':
  app.run()

[edit by admin: formatting]

What happens when you try to run the code? Do you get error messages? Or something else?