Error 404 on all pages

from future import annotations

from werkzeug.datastructures import RequestCacheControl as RCC
import sys
sys.path.insert(0, '/home/xdcc/website_and_proxy/')
from json_data import json_data
from twisted.internet import reactor
from twisted.internet.error import *
from twisted.web.server import Site
from twisted.web.wsgi import WSGIResource
from flask import make_response, render_template, redirect, url_for, Blueprint
from flask_login import current_user
from urllib.parse import urlparse
from os.path import exists
from flask_login import LoginManager
from os.path import exists
sys.path.insert(0, '/home/xdcc/website_and_proxy/')
from user_db import User
from user_db import db, app_new
from os import path

DB_NAME = "database.db"

def create_app():
    app_new.config['SECRET_KEY'] = 'hjshjhdjah kjshkjdhjs'
    app_new.config['SQLALCHEMY_DATABASE_URI'] = f'sqlite:///{DB_NAME}'
    app_new.config['SQLALCHEMY_TRACK_MODIFICATIONS'] = True
    app_new.config['SERVER_NAME'] = ''
        # json_data.home['home'].get('local_website', '') + ':' + '80'
    #root: str = json_data.home['home'].get('website_root', '/')
    root: str = '/'
    sys.path.insert(0, '/home/xdcc/website/')
    from views import views
    from auth import auth
    from __init__ import set_dirs
    if not auth:
    app_new.register_blueprint(views, url_prefix=root)
    app_new.register_blueprint(auth, url_prefix=root)


    login_manager = LoginManager()
    login_manager.login_view = '..auth.login'

    def load_user(id):
        return User.query.get(int(id))

    _dir = path.dirname(path.abspath(__file__))
    app_new.template_folder = path.join(_dir, "templates")
    app_new.static_folder = path.join(_dir, "static")
    app_dir = path.join(_dir, "app")

    set_dirs(app_new.static_folder, app_new.template_folder, app_dir)

    return app_new

def create_database(app):
    if not exists(DB_NAME):

def begin_flask():

I cannot seem to get the server to return anything but 404 on all pages. I have tried using the Twisted and without running the begin_flask function. What am I doing wrong? It was working before. Have I used up some kind of limiter on my website?

Take a look at and in particular.