0
0
Djangoframework~10 mins

CI/CD pipeline basics in Django - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to define a basic GitHub Actions workflow file for Django.

Django
name: Django CI

on: [push]

jobs:
  build:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/[1]@v3
Drag options to blanks, or click blank then click option'
Arun
Bsetup-python
Cdeploy
Dcheckout
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'setup-python' instead of 'checkout' in the first step.
Trying to run commands before checking out the code.
2fill in blank
medium

Complete the code to set up Python 3.12 in the GitHub Actions workflow.

Django
- name: Set up Python
  uses: actions/setup-python@v3
  with:
    python-version: '[1]'
Drag options to blanks, or click blank then click option'
A3.6
B3.12
C2.7
D3.8
Attempts:
3 left
💡 Hint
Common Mistakes
Using an outdated Python version like 2.7.
Forgetting to specify the Python version.
3fill in blank
hard

Fix the error in the command to install dependencies in the workflow.

Django
- name: Install dependencies
  run: pip [1] -r requirements.txt
Drag options to blanks, or click blank then click option'
Aupgrade
Bupdate
Cinstall
Ddownload
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'pip update' which is not a valid pip command.
Using 'pip upgrade' which upgrades pip itself, not packages.
4fill in blank
hard

Fill both blanks to run Django tests and collect static files in the workflow.

Django
- name: Run tests
  run: python manage.py [1]

- name: Collect static files
  run: python manage.py [2] --noinput
Drag options to blanks, or click blank then click option'
Atest
Bmigrate
Ccollectstatic
Drunserver
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'migrate' instead of 'test' to run tests.
Using 'runserver' instead of 'collectstatic' to collect static files.
5fill in blank
hard

Fill all three blanks to define a job that runs on Ubuntu, sets up Python, and installs dependencies.

Django
jobs:
  build:
    runs-on: [1]
    steps:
      - uses: actions/[2]@v3
      - name: Set up Python
        uses: actions/setup-python@v3
        with:
          python-version: '[3]'
Drag options to blanks, or click blank then click option'
Acheckout
Bubuntu-latest
C3.12
Dwindows-latest
Attempts:
3 left
💡 Hint
Common Mistakes
Using Windows runner instead of Ubuntu.
Mixing up the order of steps.