The .gitignore file specifies patterns that should intentionally be untracked by the Git version control system. The .gitignore file that we created in this recipe will ignore the Python-compiled files, local settings, collected static files, temporary directory for uploads, and media directory with the uploaded files.
If you keep all of your settings in a config Python package, as described in the Configuring settings for development, testing, staging, and production environments recipe, add settings.py to the ignored files too.