I am very new to flask and am not really sure what I'm doing. I have a python web app that works on my localhost but I cant get it to work in pythonanywhere. I think it might have to do with my AJAX url, I've tried a bunch but I'm not sure what is the correct format. "http/username.pythonanywhere.com/ebaycode" is what I tried last.
$.ajax({
url: 'http://127.0.0.1:5000/ebaycode/',
data: {'product': product, 'sold': sold, 'cond': cond},
method: 'POST'
That's part of my index.html, the top of my flask app looks like this:
app = Flask(__name__)
@app.route('/')
def index():
return render_template('index.html')
@app.route('/ebaycode', methods=['POST'])
def ebaycode():
prod = str(request.form.get('product', 0))
sold = str(request.form.get('sold', 0))
cond = str(request.form.get('cond', 0))