Fix module imports for proper application startup
This commit is contained in:
parent
8898d97d8a
commit
c1543dd5e7
@ -0,0 +1,6 @@
|
||||
"""
|
||||
Deft Trade - DeFi Trading Simulation Platform Backend
|
||||
|
||||
A secure, admin-controlled backend for a decentralized finance (DeFi)
|
||||
trading simulation platform.
|
||||
"""
|
@ -0,0 +1,14 @@
|
||||
from app.crud.crud_user import user
|
||||
from app.crud.crud_wallet import wallet
|
||||
from app.crud.crud_deposit import deposit
|
||||
from app.crud.crud_withdrawal import withdrawal
|
||||
from app.crud.crud_transaction import transaction
|
||||
from app.crud.crud_bot import bot
|
||||
from app.crud.crud_bot_purchase import bot_purchase
|
||||
from app.crud.crud_kyc import kyc
|
||||
|
||||
# Explicitly export all CRUD objects
|
||||
__all__ = [
|
||||
'user', 'wallet', 'deposit', 'withdrawal',
|
||||
'transaction', 'bot', 'bot_purchase', 'kyc'
|
||||
]
|
@ -0,0 +1,25 @@
|
||||
from app.models.user import User
|
||||
from app.models.wallet import Wallet
|
||||
from app.models.deposit import Deposit
|
||||
from app.models.withdrawal import Withdrawal
|
||||
from app.models.transaction import Transaction
|
||||
from app.models.bot import Bot
|
||||
from app.models.bot_purchase import BotPurchase
|
||||
from app.models.kyc import KYC
|
||||
|
||||
# Import enums for convenience
|
||||
from app.models.user import UserRole
|
||||
from app.models.wallet import WalletType
|
||||
from app.models.deposit import DepositStatus
|
||||
from app.models.withdrawal import WithdrawalStatus
|
||||
from app.models.transaction import TransactionType
|
||||
from app.models.bot_purchase import BotPurchaseStatus
|
||||
from app.models.kyc import KYCStatus
|
||||
|
||||
# Explicitly export all models and enums
|
||||
__all__ = [
|
||||
'User', 'Wallet', 'Deposit', 'Withdrawal', 'Transaction',
|
||||
'Bot', 'BotPurchase', 'KYC', 'UserRole', 'WalletType',
|
||||
'DepositStatus', 'WithdrawalStatus', 'TransactionType',
|
||||
'BotPurchaseStatus', 'KYCStatus'
|
||||
]
|
@ -0,0 +1,44 @@
|
||||
from app.schemas.user import (
|
||||
User, UserCreate, UserUpdate, UserInDB, Token, TokenPayload,
|
||||
RefreshToken, PasswordReset, PasswordResetConfirm, EmailVerification,
|
||||
TwoFactorSetup, TwoFactorVerify, TwoFactorLogin, TwoFactorDisable, UserRole
|
||||
)
|
||||
from app.schemas.wallet import Wallet, WalletCreate, WalletUpdate, WalletTransfer, WalletType
|
||||
from app.schemas.deposit import Deposit, DepositCreate, DepositUpdate, DepositRequest, DepositApprove, DepositReject, DepositStatus
|
||||
from app.schemas.withdrawal import Withdrawal, WithdrawalCreate, WithdrawalUpdate, WithdrawalRequest, WithdrawalApprove, WithdrawalReject, WithdrawalStatus
|
||||
from app.schemas.transaction import Transaction, TransactionCreate, TransactionUpdate, TransactionType
|
||||
from app.schemas.bot import Bot, BotCreate, BotUpdate
|
||||
from app.schemas.bot_purchase import BotPurchase, BotPurchaseCreate, BotPurchaseUpdate, BotPurchaseRequest, BotPurchaseStatus, BotPurchaseWithBot
|
||||
from app.schemas.kyc import KYC, KYCCreate, KYCUpdate, KYCApprove, KYCReject, KYCStatus, IDDocumentType
|
||||
|
||||
# Explicitly export all schema classes
|
||||
__all__ = [
|
||||
# User schemas
|
||||
'User', 'UserCreate', 'UserUpdate', 'UserInDB', 'Token', 'TokenPayload',
|
||||
'RefreshToken', 'PasswordReset', 'PasswordResetConfirm', 'EmailVerification',
|
||||
'TwoFactorSetup', 'TwoFactorVerify', 'TwoFactorLogin', 'TwoFactorDisable', 'UserRole',
|
||||
|
||||
# Wallet schemas
|
||||
'Wallet', 'WalletCreate', 'WalletUpdate', 'WalletTransfer', 'WalletType',
|
||||
|
||||
# Deposit schemas
|
||||
'Deposit', 'DepositCreate', 'DepositUpdate', 'DepositRequest', 'DepositApprove',
|
||||
'DepositReject', 'DepositStatus',
|
||||
|
||||
# Withdrawal schemas
|
||||
'Withdrawal', 'WithdrawalCreate', 'WithdrawalUpdate', 'WithdrawalRequest',
|
||||
'WithdrawalApprove', 'WithdrawalReject', 'WithdrawalStatus',
|
||||
|
||||
# Transaction schemas
|
||||
'Transaction', 'TransactionCreate', 'TransactionUpdate', 'TransactionType',
|
||||
|
||||
# Bot schemas
|
||||
'Bot', 'BotCreate', 'BotUpdate',
|
||||
|
||||
# Bot purchase schemas
|
||||
'BotPurchase', 'BotPurchaseCreate', 'BotPurchaseUpdate', 'BotPurchaseRequest',
|
||||
'BotPurchaseStatus', 'BotPurchaseWithBot',
|
||||
|
||||
# KYC schemas
|
||||
'KYC', 'KYCCreate', 'KYCUpdate', 'KYCApprove', 'KYCReject', 'KYCStatus', 'IDDocumentType'
|
||||
]
|
22
test_app.py
Normal file
22
test_app.py
Normal file
@ -0,0 +1,22 @@
|
||||
import sys
|
||||
from importlib import import_module
|
||||
|
||||
# Simple test script to check for import errors
|
||||
try:
|
||||
# Import main module
|
||||
print("Importing main module...")
|
||||
main = import_module("main")
|
||||
print("Main module imported successfully!")
|
||||
|
||||
# Try to import the app
|
||||
print("Importing app...")
|
||||
app = getattr(main, "app")
|
||||
print("App imported successfully!")
|
||||
|
||||
print("All imports successful! The application should run without errors.")
|
||||
sys.exit(0)
|
||||
except Exception as e:
|
||||
print(f"Error importing application: {e}")
|
||||
import traceback
|
||||
traceback.print_exc()
|
||||
sys.exit(1)
|
Loading…
x
Reference in New Issue
Block a user