#!/usr/bin/env python """Development server with SQLite support (patches engine options).""" import os import sys # Set environment for development with SQLite os.environ['FLASK_ENV'] = 'development' os.environ['DATABASE_URL'] = f"sqlite:///{os.path.abspath('instance/shopdb.db')}" # Import and patch config before app creation from shopdb.config import DevelopmentConfig from sqlalchemy.pool import StaticPool # Override engine options for SQLite (no charset parameter) DevelopmentConfig.SQLALCHEMY_ENGINE_OPTIONS = { 'connect_args': {'check_same_thread': False}, 'poolclass': StaticPool, } # Now import and run the app from shopdb import create_app app = create_app('development') if __name__ == '__main__': app.run(debug=True, host='127.0.0.1', port=5000)