Hello everyone, I have just updated my Flask code and it suddenly stopped working. When I try to go the index page I get "Error code: Unhandled Exception". Error log:
2017-01-29 14:39:05,912 :Error running WSGI application
2017-01-29 14:39:05,964 :ImportError: cannot import name 'app'
2017-01-29 14:39:05,965 : File "/var/www/neonbevz_pythonanywhere_com_wsgi.py", line 16, in <module>
2017-01-29 14:39:05,965 : from test import app as application
Code for index:
from flask import Flask, render_template, request, session
from generator import *
app = Flask(__name__)
app.secret_key = '01010101011100001010'
@app.route("/")
def index():
session["A"] = random.randint(10,40)
session["Y"], session["P"] = num_gen()
session["a"] = halfkey_gen(session["Y"], session["A"], session["P"])
return render_template('index.html', Y=session["Y"], P=session["P"], a=session["a"])
I didn't change anything except index(). Any ideas how to solve this? Thanks in advance.