40 lines
985 B
Python
40 lines
985 B
Python
"""
|
|
Configuration settings for the application
|
|
"""
|
|
|
|
import os
|
|
|
|
|
|
class Config:
|
|
"""Base configuration class"""
|
|
|
|
# Flask settings
|
|
SECRET_KEY = os.environ.get('SECRET_KEY') or os.urandom(24)
|
|
|
|
# Upload settings
|
|
UPLOAD_FOLDER = os.environ.get('UPLOAD_FOLDER') or 'app/static/uploads'
|
|
MAX_CONTENT_LENGTH = 16 * 1024 * 1024 # 16MB max file size
|
|
ALLOWED_EXTENSIONS = {'png', 'jpg', 'jpeg', 'gif'}
|
|
|
|
# Authentication settings
|
|
ADMIN_USERNAME = os.environ.get('ADMIN_USERNAME') or 'admin'
|
|
ADMIN_PASSWORD = os.environ.get('ADMIN_PASSWORD') or 'password123'
|
|
|
|
# Database settings
|
|
DATABASE_PATH = os.environ.get('DATABASE_PATH') or 'pet_pictures.db'
|
|
|
|
|
|
class DevelopmentConfig(Config):
|
|
"""Development configuration"""
|
|
DEBUG = True
|
|
|
|
|
|
class ProductionConfig(Config):
|
|
"""Production configuration"""
|
|
DEBUG = False
|
|
|
|
|
|
class TestingConfig(Config):
|
|
"""Testing configuration"""
|
|
TESTING = True
|
|
DATABASE_PATH = ':memory:' |