I have been trying to solve this error for almost 2 days have tried various posts from multiple places like github, stack overflow, and even daniweb. None have helped so far. So expecting atleast explaination for issue if you don't have answer.
So here how I am creating database in connections.py

from flask import Flask
from flask_sqlalchemy import SQLAlchemy
#from app import app
from werkzeug.security import generate_password_hash, check_password_hash

app = Flask(__name__)

db = SQLAlchemy(app)

class wreport(db.Model):
    _id = db.Column("id", db.Integer, primary_key=True)
    tname = db.Column("teacher_name", db.String(255))

   def __init__(self,tname):
        self.tname = tname

and I am calling the class in app.py. There is no init.py

from flask import (Flask, request, redirect, render_template, url_for, session, blueprints, flash)
from flask_sqlalchemy import SQLAlchemy
import config

app = Flask(__name__)

app.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite:///report.sqlite3'
app.config['SECRET_KEY']= 'Teachers Report'

from connection import (db, users, wreport, dreport, students)


#Example of how I am calling the class and trying to pass them
@app.route('/weekly', methods = ["POST", "GET"])
def weekly():
    if request.method == 'POST':
        wreports = wreport(request.form['tname'])

#I am also passing posting the initialization section


if __name__ == "__main__":

I tried calling db.create_all() from the connections.py but it doesn't work either. I am doing proper import of wreport class in app.py.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of 1.18 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.