mirror of
https://github.com/thecyberlearn/quantumtaskai-caprover.git
synced 2026-08-18 07:52:55 +00:00
BREAKING CHANGES: - Remove complex security middleware, validators, and cache utils - Replace 430-line CLAUDE.md with 156-line simplified version - Remove 5 complex CapRover optimization docs (1,000+ lines) - Add simplified alternatives: * simple_settings.py - Basic Django config * simple_services.py - No-cache agent management * requirements-simple.txt - 10 vs 24 dependencies * Dockerfile.simple - Streamlined container * README-SIMPLE.md - Focused deployment guide RATIONALE: - Original was enterprise-grade (Redis, CSP, security monitoring) - New version focuses on core CapRover deployment needs - 75% reduction in documentation complexity - Removed: Redis, rate limiting, security scanning, rollback systems - Kept: Basic Django, agents, auth, payments, static files 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
139 lines
3.6 KiB
Python
139 lines
3.6 KiB
Python
"""
|
|
Simplified Django settings for CapRover deployment
|
|
"""
|
|
|
|
from pathlib import Path
|
|
from decouple import config
|
|
import os
|
|
|
|
BASE_DIR = Path(__file__).resolve().parent.parent
|
|
|
|
# Security
|
|
SECRET_KEY = config('SECRET_KEY', default='your-secret-key-here')
|
|
DEBUG = config('DEBUG', default=False, cast=bool)
|
|
ALLOWED_HOSTS = config('ALLOWED_HOSTS', default='*').split(',')
|
|
|
|
# Application definition
|
|
INSTALLED_APPS = [
|
|
'django.contrib.admin',
|
|
'django.contrib.auth',
|
|
'django.contrib.contenttypes',
|
|
'django.contrib.sessions',
|
|
'django.contrib.messages',
|
|
'django.contrib.staticfiles',
|
|
'rest_framework',
|
|
|
|
# Local apps
|
|
'core',
|
|
'authentication',
|
|
'agents',
|
|
'wallet',
|
|
]
|
|
|
|
MIDDLEWARE = [
|
|
'django.middleware.security.SecurityMiddleware',
|
|
'whitenoise.middleware.WhiteNoiseMiddleware',
|
|
'django.contrib.sessions.middleware.SessionMiddleware',
|
|
'django.middleware.common.CommonMiddleware',
|
|
'django.middleware.csrf.CsrfViewMiddleware',
|
|
'django.contrib.auth.middleware.AuthenticationMiddleware',
|
|
'django.contrib.messages.middleware.MessageMiddleware',
|
|
'django.middleware.clickjacking.XFrameOptionsMiddleware',
|
|
]
|
|
|
|
ROOT_URLCONF = 'netcop_hub.urls'
|
|
|
|
TEMPLATES = [
|
|
{
|
|
'BACKEND': 'django.template.backends.django.DjangoTemplates',
|
|
'DIRS': [BASE_DIR / 'templates'],
|
|
'APP_DIRS': True,
|
|
'OPTIONS': {
|
|
'context_processors': [
|
|
'django.template.context_processors.debug',
|
|
'django.template.context_processors.request',
|
|
'django.contrib.auth.context_processors.auth',
|
|
'django.contrib.messages.context_processors.messages',
|
|
],
|
|
},
|
|
},
|
|
]
|
|
|
|
WSGI_APPLICATION = 'netcop_hub.wsgi.application'
|
|
|
|
# Database
|
|
DATABASES = {
|
|
'default': {
|
|
'ENGINE': 'django.db.backends.sqlite3',
|
|
'NAME': BASE_DIR / 'db.sqlite3',
|
|
}
|
|
}
|
|
|
|
# Use PostgreSQL if DATABASE_URL is provided (production)
|
|
database_url = config('DATABASE_URL', default='')
|
|
if database_url:
|
|
import dj_database_url
|
|
DATABASES['default'] = dj_database_url.parse(database_url)
|
|
|
|
# Custom user model
|
|
AUTH_USER_MODEL = 'authentication.User'
|
|
|
|
# Internationalization
|
|
LANGUAGE_CODE = 'en-us'
|
|
TIME_ZONE = 'UTC'
|
|
USE_I18N = True
|
|
USE_TZ = True
|
|
|
|
# Static files
|
|
STATIC_URL = '/static/'
|
|
STATICFILES_DIRS = [BASE_DIR / 'static']
|
|
STATIC_ROOT = BASE_DIR / 'staticfiles'
|
|
|
|
# WhiteNoise for static files in production
|
|
STATICFILES_STORAGE = 'whitenoise.storage.CompressedManifestStaticFilesStorage'
|
|
|
|
# Media files
|
|
MEDIA_URL = '/media/'
|
|
MEDIA_ROOT = BASE_DIR / 'media'
|
|
|
|
# Default primary key field type
|
|
DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField'
|
|
|
|
# Email configuration
|
|
EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend'
|
|
if not DEBUG:
|
|
EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend'
|
|
EMAIL_HOST = 'smtp.gmail.com'
|
|
EMAIL_PORT = 587
|
|
EMAIL_USE_TLS = True
|
|
EMAIL_HOST_USER = config('EMAIL_HOST_USER', default='')
|
|
EMAIL_HOST_PASSWORD = config('EMAIL_HOST_PASSWORD', default='')
|
|
|
|
# Stripe configuration
|
|
STRIPE_SECRET_KEY = config('STRIPE_SECRET_KEY', default='')
|
|
STRIPE_WEBHOOK_SECRET = config('STRIPE_WEBHOOK_SECRET', default='')
|
|
|
|
# REST Framework
|
|
REST_FRAMEWORK = {
|
|
'DEFAULT_AUTHENTICATION_CLASSES': [
|
|
'rest_framework.authentication.SessionAuthentication',
|
|
],
|
|
'DEFAULT_PERMISSION_CLASSES': [
|
|
'rest_framework.permissions.IsAuthenticated',
|
|
],
|
|
}
|
|
|
|
# Logging
|
|
LOGGING = {
|
|
'version': 1,
|
|
'disable_existing_loggers': False,
|
|
'handlers': {
|
|
'console': {
|
|
'class': 'logging.StreamHandler',
|
|
},
|
|
},
|
|
'root': {
|
|
'handlers': ['console'],
|
|
'level': 'INFO',
|
|
},
|
|
} |