We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Code: "from flask import Flask from flask_sqlalchemy import SQLAlchemy from os import path
db = SQLAlchemy() DB_NAME = "CSIA.db"
def create_app(): app = Flask(name) app.config['SECRET_KEY'] = 'www' app.config['SQLALCHEMY_DATABASE_URI'] = f'sqlite:///{DB_NAME}' db.init_app(app)
from .views import views from .auth import auth app.register_blueprint(views, url_prefix='/') app.register_blueprint(auth, url_prefix='/') from .models import Admin, Employees, Product, Order, OrderItem, InventoryPage, Supplier create_database(app) with app.app_context(): db.create_all() return app
def create_database(app): if not path.exists('Website/' + DB_NAME): db.create_all(app=app) print('Created Database!') "
Error: "S D:\MY PC\Documents> & "C:/Program Files/Python312/python.exe" "d:/MY PC/Documents/main.py" Traceback (most recent call last): File "d:\MY PC\Documents\main.py", line 3, in app = create_app() ^^^^^^^^^^^^ File "d:\MY PC\Documents\Website_init_.py", line 22, in create_app create_database(app) File "d:\MY PC\Documents\Website_init_.py", line 30, in create_database db.create_all(app=app) TypeError: SQLAlchemy.create_all() got an unexpected keyword argument 'app'"
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Code:
"from flask import Flask
from flask_sqlalchemy import SQLAlchemy
from os import path
db = SQLAlchemy()
DB_NAME = "CSIA.db"
def create_app():
app = Flask(name)
app.config['SECRET_KEY'] = 'www'
app.config['SQLALCHEMY_DATABASE_URI'] = f'sqlite:///{DB_NAME}'
db.init_app(app)
def create_database(app):
if not path.exists('Website/' + DB_NAME):
db.create_all(app=app)
print('Created Database!')
"
Error:
"S D:\MY PC\Documents> & "C:/Program Files/Python312/python.exe" "d:/MY PC/Documents/main.py"
Traceback (most recent call last):
File "d:\MY PC\Documents\main.py", line 3, in
app = create_app()
^^^^^^^^^^^^
File "d:\MY PC\Documents\Website_init_.py", line 22, in create_app
create_database(app)
File "d:\MY PC\Documents\Website_init_.py", line 30, in create_database
db.create_all(app=app)
TypeError: SQLAlchemy.create_all() got an unexpected keyword argument 'app'"
The text was updated successfully, but these errors were encountered: