Forums

OSError: [Errno 98] Address already in use

i keep on getting errors here is my wsgi file

# This file contains the WSGI configuration required to serve up your

web application at http://<your-username>.pythonanywhere.com/

It works by setting the variable 'application' to a WSGI handler of some

description.

The below has been auto-generated for your Flask project

import sys

add your project directory to the sys.path

project_home = '/home/thelegendofmog/quizmaker' if project_home not in sys.path: sys.path = [project_home] + sys.path

import flask app but need to call it "application" for WSGI to work

from main.py import application # noqa

here is my main.py

from flask import Flask, render_template, request, redirect, url_for, Blueprint, flash import ahp, json from flask import session as sssession

key = "6661828b5f94e4bldkjsfajfeiebae79788c477ae6b74f70zzxcxcxcvzxcf182afe054f9c5ba26dbdb36" from ahp.auth_routes import check_if_login

application = ahp.create_app()

@application.route('/', methods=["POST", "GET"]) def home(): try: check = check_if_login(sssession['password'], sssession['name']) print(check) if check == 'success': return render_template('success.html', x=sssession['name'], b=True) return render_template('home.html', b=False)

except:
    return render_template('home.html', b=False)

application.config['SECRET_KEY'] = key

application.run('0.0.0.0')

Take a look at https://help.pythonanywhere.com/pages/Flask and https://help.pythonanywhere.com/pages/Flask#do-not-use-apprun in particular.