0
0
Djangoframework~20 mins

CI/CD pipeline basics in Django - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
CI/CD Mastery Badge
Get all challenges correct to earn this badge!
Test your skills under time pressure!
💻 Command Output
intermediate
2:00remaining
Output of a basic GitLab CI pipeline job
Given this simple GitLab CI job configuration, what will be the output when the job runs successfully?
Django
test_job:
  script:
    - echo "Running Django tests"
    - python manage.py test
ARunning Django tests\nSyntaxError: invalid syntax
BRunning Django tests\nNo tests found.
CError: python command not found
DRunning Django tests\nCreating test database for alias 'default'...\nSystem check identified no issues (0 silenced).\n...\nOK
Attempts:
2 left
💡 Hint
Think about what the 'python manage.py test' command outputs when tests pass.
🧠 Conceptual
intermediate
1:30remaining
Purpose of a CI/CD pipeline stage
In a CI/CD pipeline for a Django project, what is the main purpose of the 'build' stage?
ATo compile source code and prepare artifacts for deployment
BTo deploy the application to the production server
CTo run automated tests on the codebase
DTo monitor application performance after deployment
Attempts:
2 left
💡 Hint
Think about what 'build' means in software pipelines.
🔀 Workflow
advanced
2:30remaining
Correct order of CI/CD pipeline stages
Arrange the following CI/CD pipeline stages in the correct order for a Django project deployment.
A3,1,2,4
B3,2,1,4
C2,3,1,4
D1,3,2,4
Attempts:
2 left
💡 Hint
Think about what must happen before testing and deployment.
Troubleshoot
advanced
2:00remaining
Troubleshooting a failing Django test job in CI
A CI job running 'python manage.py test' fails with the error: 'ModuleNotFoundError: No module named 'django''. What is the most likely cause?
AThe test command syntax is incorrect
BThe test database is not configured correctly
CDjango is not installed in the CI environment before tests run
DThe tests contain syntax errors
Attempts:
2 left
💡 Hint
Consider what causes 'ModuleNotFoundError' in Python.
Best Practice
expert
3:00remaining
Best practice for secret management in CI/CD pipelines
What is the best practice for handling sensitive information like database passwords in a CI/CD pipeline for a Django application?
AStore secrets in environment variables managed by the CI/CD platform and inject them at runtime
BHardcode secrets in the Django settings file committed to the repository
CSend secrets via email to the deployment team before each deployment
DInclude secrets in the Docker image used for deployment
Attempts:
2 left
💡 Hint
Think about security and automation in pipelines.