Complete the code to add static files URL pattern in development.
from django.conf import settings from django.conf.urls.static import static urlpatterns = [ # your url patterns here ] + static(settings.STATIC_URL, document_root=[1])
In development, static files are served from settings.STATIC_ROOT using static() helper.
Complete the setting to enable static files serving in development.
DEBUG = [1]Static files are served automatically by Django only when DEBUG is True.
Fix the error in the static files URL pattern code.
from django.conf.urls.static import static from django.conf import settings urlpatterns += static(settings.STATIC_URL, document_root=[1])
The document_root must point to STATIC_ROOT for static files, not MEDIA_ROOT or others.
Fill both blanks to create a dictionary comprehension for static files sizes.
sizes = {file: os.path.getsize([1]) for file in os.listdir([2])}To get file sizes, join the static root path with each file name and list files from STATIC_ROOT.
Fill all three blanks to filter static files by size greater than 1024 bytes.
large_files = {file: size for file, size in sizes.items() if size [1] [2]
path = [3]The code filters files with size greater than 1024 bytes and sets path to STATIC_ROOT.