first commit

This commit is contained in:
Beyhan Oğur
2026-04-26 22:22:29 +03:00
commit ec28a2024d
208 changed files with 23836 additions and 0 deletions

31
entrypoint.sh Normal file
View File

@@ -0,0 +1,31 @@
#!/bin/bash
# Hata durumunda scripti durdur
set -e
# PostgreSQL bağlantısını kontrol et (mevcut sunucu için)
echo "Checking PostgreSQL connection..."
# Not: Mevcut PostgreSQL sunucunuz zaten çalışıyor olmalı (10.80.80.50:5432)
# Veritabanı migrasyonlarını uygula
echo "Applying database migrations..."
python manage.py migrate --noinput
# Superuser oluştur (eğer yoksa)
echo "Creating superuser if it doesn't exist..."
python manage.py shell -c "
from django.contrib.auth import get_user_model
User = get_user_model()
if not User.objects.filter(email='admin@example.com').exists():
User.objects.create_superuser('admin@example.com', 'admin')
print('Superuser created: admin@example.com / admin')
else:
print('Superuser already exists')
" || true
# Static dosyaları topla
echo "Collecting static files..."
python manage.py collectstatic --noinput --clear
echo "Starting server..."
exec "$@"