🔧 Fix Django 4.0+ CSRF_TRUSTED_ORIGINS and CI settings
Some checks failed
continuous-integration/drone/push Build is failing
Some checks failed
continuous-integration/drone/push Build is failing
✅ Fixed issues: - Added proper CSRF_TRUSTED_ORIGINS with schemes (http://, https://) - Added missing sys import in test settings - Updated ALLOWED_HOSTS to include 'postgres' container - Removed duplicate database creation in CI pipeline - Fixed empty CSRF_TRUSTED_ORIGINS causing Django 4.0.E001 error 🐳 CI/CD improvements: - Database container properly referenced in settings - Test environment variables correctly configured - Eliminated database creation conflicts Ready for trusted repository CI/CD execution!
This commit is contained in:
@@ -60,7 +60,7 @@ steps:
|
||||
DATABASE_URL: postgresql://postgres:postgres@postgres:5432/smartsoltech_test
|
||||
SECRET_KEY: test-secret-key-for-ci-very-long-and-secure-key-12345
|
||||
DEBUG: "False"
|
||||
ALLOWED_HOSTS: localhost,127.0.0.1
|
||||
ALLOWED_HOSTS: localhost,127.0.0.1,postgres
|
||||
DJANGO_SETTINGS_MODULE: smartsoltech.settings_test
|
||||
commands:
|
||||
- apt-get update && apt-get install -y libpq-dev gcc curl postgresql-client
|
||||
@@ -70,8 +70,6 @@ steps:
|
||||
- sleep 15
|
||||
- echo "Checking database connection..."
|
||||
- until pg_isready -h postgres -p 5432 -U postgres; do echo "Waiting for postgres..."; sleep 2; done
|
||||
- echo "Creating test database..."
|
||||
- PGPASSWORD=postgres createdb -h postgres -U postgres smartsoltech_test || echo "Database already exists"
|
||||
- echo "Checking migrations..."
|
||||
- cd smartsoltech
|
||||
- python manage.py check --settings=smartsoltech.settings_test
|
||||
@@ -87,7 +85,7 @@ steps:
|
||||
DATABASE_URL: postgresql://postgres:postgres@postgres:5432/smartsoltech_test
|
||||
SECRET_KEY: test-secret-key-for-ci-very-long-and-secure-key-12345
|
||||
DEBUG: "False"
|
||||
ALLOWED_HOSTS: localhost,127.0.0.1
|
||||
ALLOWED_HOSTS: localhost,127.0.0.1,postgres
|
||||
TELEGRAM_BOT_TOKEN: test-token-for-ci
|
||||
DJANGO_SETTINGS_MODULE: smartsoltech.settings_test
|
||||
commands:
|
||||
|
||||
Reference in New Issue
Block a user