G
GitIgnore.pro

Flask .gitignore by Scenario

Choose your Flask .gitignore based on your project type. From lightweight microservices to full web applications, get the perfect ignore patterns for your specific use case.

Microservices

API-first, minimal footprint

Web Applications

Full-stack with templates & assets

Cloud Native

Docker, K8s, serverless

Select Your Flask Project Type

Microservice API

Lightweight Flask API with minimal dependencies

Perfect for: REST APIs, authentication services, data processors

Full Web Application

Complete Flask web app with templates and static files

Perfect for: E-commerce sites, blogs, dashboards, CMS

Dockerized Flask

Flask application with Docker containerization

Perfect for: Cloud deployment, microservices architecture, CI/CD

Microservice API

Perfect for: REST APIs, authentication services, data processors

# Flask Microservice .gitignore

# Flask instance folder
instance/

# Environment variables
.env
.env.local
.flaskenv

# Python
__pycache__/
*.py[cod]
*$py.class
*.so
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
*.egg-info/
.installed.cfg
*.egg

# Virtual environments
venv/
ENV/
env/
.venv/

# Database
*.db
*.sqlite
*.sqlite3

# Logs
*.log
logs/
app.log

# Testing
.pytest_cache/
.coverage
.coverage.*
htmlcov/
.tox/
.nox/

# IDE
.vscode/
.idea/
*.swp
*.swo

# OS generated files
.DS_Store
.DS_Store?
._*
.Spotlight-V100
.Trashes
ehthumbs.db
Thumbs.db

# Deployment
*.pyc
.cache/

Deployment-Specific Patterns

🚀

Heroku Deployment

Procfile, runtime.txt, requirements.txt

# Heroku specific .env .env.local staticfiles/ .herokuapp/
☁️

AWS Lambda

zappa_settings.json, lambda packages

# AWS Lambda .aws/ zappa_settings.json lambda_packages/ *.zip
🐳

Docker Compose

docker-compose.yml, volumes

# Docker Compose docker-compose.override.yml volumes/ .docker/
⚙️

Traditional Server

Nginx configs, systemd services

# Traditional deployment *.conf *.service deployment_scripts/

Flask Configuration Guidelines

Essential Patterns

Instance folder:instance/
Environment files:.env .flaskenv
Upload directories:/uploads/ /media/

Advanced Considerations

Blueprint Structure

Large Flask apps with blueprints may need specific static file handling

Database Migrations

Consider team policy for Flask-Migrate version files

Testing Strategy

Include test databases and coverage reports in ignores

Ready to Build Your Flask Project?

Start with the right .gitignore configuration and avoid common pitfalls from day one.

🔧 Customize with Generator →