diff --git a/.gitignore b/.gitignore index 7debeac8f52828ebb55e353ad7b04fed33a4998e..c335a77f723bf1a51d0552a553bfa19b6d157922 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ .DS_Store +.vscode /backend/venv -/backend/__pycache__/ \ No newline at end of file +/backend/__pycache__/ diff --git a/backend/app.py b/backend/app.py index 98f909a0227961adee0bbdaa4fe574b8f3a35713..0393af024a2de6a1203861a0657267c7a9b61ca4 100644 --- a/backend/app.py +++ b/backend/app.py @@ -4,7 +4,7 @@ from flask import current_app from flask_sqlalchemy import SQLAlchemy from config import Config from flask_security import Security, SQLAlchemyUserDatastore, auth_required, hash_password -from models import db, User, Role +from models_shared import db, User, Role from flask_security.models import fsqla_v3 as fsqla # Create app @@ -17,10 +17,10 @@ if not app.config['DEBUG']: exit("App is not secure, security configurations for production environment must be made") # Register the blueprints with the app -from server import default as default_blueprint +from routes_default import default as default_blueprint app.register_blueprint(default_blueprint) -from auth import auth as auth_blueprint +from routes_auth import auth as auth_blueprint app.register_blueprint(auth_blueprint) # Setup Flask Security diff --git a/backend/config.py b/backend/config.py index 0874b841116d44e874dd3073e1562132f8f1b5e1..09d77161142ef5be93d5ee7db6007fd68672d07a 100644 --- a/backend/config.py +++ b/backend/config.py @@ -10,4 +10,6 @@ class Config: REMEMBER_COOKIE_SAMESITE = "strict" SESSION_COOKIE_SAMESITE = "strict" # Use an in-memory db - SQLALCHEMY_DATABASE_URI = 'sqlite://' \ No newline at end of file + SQLALCHEMY_DATABASE_URI = 'sqlite://' + SQLALCHEMY_ECHO = True + diff --git a/backend/models.py b/backend/models_shared.py similarity index 100% rename from backend/models.py rename to backend/models_shared.py diff --git a/backend/auth.py b/backend/routes_auth.py similarity index 100% rename from backend/auth.py rename to backend/routes_auth.py diff --git a/backend/server.py b/backend/routes_default.py old mode 100755 new mode 100644 similarity index 91% rename from backend/server.py rename to backend/routes_default.py index 3090dde4eb71cb949db477fe4437f2e2a139a4a7..0b2e408cbed0c6870ad61b58d334ba3565a333d3 --- a/backend/server.py +++ b/backend/routes_default.py @@ -1,4 +1,4 @@ -from models import db, User +from models_shared import db, User from flask import Blueprint, jsonify default = Blueprint("default", __name__)