Team Ai
Apppublic

Purva09/algorithm-battlefield

sourceHugging Faceupdated 4mo agoView on Hugging Face
0likes
config.py84 linesDownload Raw Back to root
1"""Flask Configuration"""2 3import os4from datetime import timedelta5 6# Environment7ENV = os.environ.get('FLASK_ENV', 'development')8DEBUG = ENV == 'development'9 10# Secret key for session management11SECRET_KEY = os.environ.get('SECRET_KEY', 'algorithm-battlefield-arena-secret-key-2024-dev')12 13# Session configuration14PERMANENT_SESSION_LIFETIME = timedelta(hours=1)15SESSION_PERMANENT = True16SESSION_TYPE = 'filesystem'17SESSION_COOKIE_SECURE = False  # Set to True in production with HTTPS18SESSION_COOKIE_HTTPONLY = True19SESSION_COOKIE_SAMESITE = 'Lax'20 21# Flask settings22JSON_SORT_KEYS = False23JSONIFY_PRETTYPRINT_REGULAR = False24 25# Max content length (for file uploads, etc.)26MAX_CONTENT_LENGTH = 16 * 1024 * 1024  # 16 MB27 28# Timeout for algorithm execution (in seconds)29ALGORITHM_TIMEOUT = 3030 31# Default algorithm input size32DEFAULT_INPUT_SIZE = 5033 34# Maximum algorithm input size35MAX_INPUT_SIZE = 50036 37# Algorithm configuration38ALGORITHM_CONFIG = {39    'sorting': {40        'input_type': 'array',41        'default_size': 50,42        'max_size': 50043    },44    'searching': {45        'input_type': 'array',46        'default_size': 50,47        'max_size': 50048    },49    'shortest path': {50        'input_type': 'graph',51        'default_size': 20,52        'max_size': 10053    },54    'mst': {55        'input_type': 'edges',56        'default_size': 20,57        'max_size': 10058    },59    'graph': {60        'input_type': 'graph',61        'default_size': 20,62        'max_size': 10063    },64    'string matching': {65        'input_type': 'text',66        'default_size': 100,67        'max_size': 1000068    },69    'subset generation': {70        'input_type': 'array',71        'default_size': 15,72        'max_size': 2573    },74    '0/1 knapsack': {75        'input_type': 'knapsack',76        'default_size': 15,77        'max_size': 2078    }79}80 81# Logging configuration82LOG_LEVEL = 'INFO'83LOG_FORMAT = '%(asctime)s - %(name)s - %(levelname)s - %(message)s'84