Complete the code to define the directory for static files in Django settings.
STATIC_URL = '/static/' STATICFILES_DIRS = [[1]]
In Django, STATICFILES_DIRS should point to the folder where your static files are stored during development. Using BASE_DIR / 'static' correctly sets this path.
Complete the code to collect static files into a single directory for deployment.
python manage.py [1]The collectstatic command gathers all static files from your apps and places them into the directory specified by STATIC_ROOT for easy serving in production.
Fix the error in the template tag to load static files correctly.
{% load [1] %}
<img src="{% static 'images/logo.png' %}" alt="Logo">The correct template tag to load static files in Django templates is static. This enables the use of the {% static %} tag to reference static assets.
Fill both blanks to configure static root and URL in Django settings for production.
STATIC_URL = '[1]' STATIC_ROOT = BASE_DIR / '[2]'
For production, STATIC_URL is usually set to '/static/' and STATIC_ROOT points to a folder like 'staticfiles' where collected static files are stored.
Fill all three blanks to create a dictionary comprehension filtering static files by extension.
static_files = {file: path for file, path in files.items() if file.endswith([1]) or file.endswith([2]) or file.endswith([3])}This comprehension filters files to include only CSS, JavaScript, and PNG image files, which are common static file types.