Fix STATIC_ROOT configuration and improve production settings
- Add STATIC_ROOT and MEDIA_ROOT settings with environment variable support - Update settings.py to use environment variables for SECRET_KEY, DEBUG, ALLOWED_HOSTS, TIME_ZONE - Improve docker-entrypoint.sh to auto-create static/media directories - Always run collectstatic in Docker (not just production) - Add check_settings.py script for configuration verification - Add PRODUCTION_CHECKLIST.md for deployment guide - Update .env.example with all configuration options - Update .gitignore for proper static/media file handling This fixes the ImproperlyConfigured error when deploying with Docker. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -2,6 +2,13 @@
|
||||
set -e
|
||||
|
||||
echo "Starting Django application..."
|
||||
echo "Environment: ${DJANGO_ENV:-development}"
|
||||
echo ""
|
||||
|
||||
# 정적/미디어 파일 디렉토리 생성
|
||||
echo "Creating directories..."
|
||||
mkdir -p /app/staticfiles
|
||||
mkdir -p /app/mediafiles
|
||||
|
||||
# 데이터베이스 마이그레이션
|
||||
echo "Running database migrations..."
|
||||
@@ -11,11 +18,13 @@ python manage.py migrate --noinput
|
||||
echo "Initializing strategies..."
|
||||
python manage.py init_strategies
|
||||
|
||||
# 정적 파일 수집 (production 환경에서만)
|
||||
if [ "$DJANGO_ENV" = "production" ]; then
|
||||
echo "Collecting static files..."
|
||||
python manage.py collectstatic --noinput
|
||||
fi
|
||||
# 정적 파일 수집
|
||||
echo "Collecting static files..."
|
||||
python manage.py collectstatic --noinput --clear
|
||||
|
||||
echo ""
|
||||
echo "Django application ready!"
|
||||
echo ""
|
||||
|
||||
# 전달된 명령어 실행
|
||||
exec "$@"
|
||||
|
||||
Reference in New Issue
Block a user