Django gitignore

实用

# 配置文件
.DS_Store
.idea/

# 编译文件
__pycache__/       
*.py[cod]
*$py.class            


# Django 项目中的日志文件和本地配置文件
*.log    
local_settings.py
db.sqlite3
db.sqlite3-journal

# 虚拟环境
.env            
.venv
env/
venv/
ENV/
env.bak/
venv.bak/

全部

# Byte-compiled / optimized / DLL files
__pycache__/       """Python 文件编译后的缓存目录。git上传时会忽略该目录下的文件"""
*.py[cod]        """Python 文件编译后的字节码文件(如 .pyc、.pyo、.pyd)。"""
*$py.class        """Python 文件编译后的类文件。"""

# C extensions
*.so    """C 语言扩展生成的共享库文件。"""

# Distribution / packaging
.Python
build/
develop-eggs/    """.Python、build/、develop-eggs/ 等:这些是 Python 包分发和构建过程中生成的一些临时文件和目录。"""
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
share/python-wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST

# PyInstaller        
#  Usually these files are written by a python script from a template
#  before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec        """*.manifest、*.spec:PyInstaller 构建可执行文件时生成的配置和清单文件。"""

# Installer logs
pip-log.txt
pip-delete-this-directory.txt
"""pip-log.txt、pip-delete-this-directory.txt:pip 安装日志文件。"""

# Unit test / coverage reports  
htmlcov/        """htmlcov/、.tox/ 等:单元测试和覆盖率报告生成的文件和目录。"""
.tox/
.nox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
*.py,cover
.hypothesis/
.pytest_cache/
cover/

# Translations
*.mo
*.pot        """*.mo、*.pot:国际化的翻译文件。"""

# Django stuff:
*.log            """*.log、local_settings.py 等:Django 项目中的日志文件和本地配置文件。"""
local_settings.py
db.sqlite3
db.sqlite3-journal

# Flask stuff:
instance/
.webassets-cache

# Scrapy stuff:
.scrapy            """.scrapy:Scrapy 爬虫框架的相关文件。"""

# Sphinx documentation
docs/_build/            """docs/_build/:Sphinx 生成文档的构建目录。"""

# PyBuilder
.pybuilder/                """.pybuilder/、target/:PyBuilder 构建工具生成的文件。"""
target/

# Jupyter Notebook
.ipynb_checkpoints        """.ipynb_checkpoints:Jupyter Notebook 的检查点文件。"""

# IPython
profile_default/            """profile_default/、ipython_config.py:IPython 的配置和默认配置文件。"""
ipython_config.py

# pyenv
#   For a library or package, you might want to ignore these files since the code is
#   intended to run in multiple environments; otherwise, check them in:
# .python-version 
 """.python-version:pyenv 使用的 Python 版本文件。"""

# pipenv
#   According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
#   However, in case of collaboration, if having platform-specific dependencies or dependencies
#   having no cross-platform support, pipenv may install dependencies that don't work, or not
#   install all needed dependencies.
#Pipfile.lock

# poetry
#   Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
#   This is especially recommended for binary packages to ensure reproducibility, and is more
#   commonly ignored for libraries.
#   https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
#poetry.lock

# pdm
#   Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
#pdm.lock
#   pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
#   in version control.
#   https://pdm.fming.dev/latest/usage/project/#working-with-version-control
.pdm.toml
.pdm-python
.pdm-build/        """.pdm.toml、.pdm-python、.pdm-build/:pdm 相关的配置和构建文件。"""

# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
__pypackages__/
"""__pypackages__/:PEP 582 定义的包目录。"""
# Celery stuff
celerybeat-schedule
celerybeat.pid
"""celerybeat-schedule、celerybeat.pid:Celery 任务调度器的相关文件。"""
# SageMath parsed files
*.sage.py
"""*.sage.py:SageMath 解析生成的 Python 文件。"""
# Environments
.env            """.env、.venv 等:虚拟环境相关文件。"""
.venv
env/
venv/
ENV/
env.bak/
venv.bak/

# Spyder project settings
.spyderproject            """.spyderproject、.spyproject:Spyder IDE 的项目设置文件。"""
.spyproject

# Rope project settings
.ropeproject
""".ropeproject:Rope(Python 重构工具)的项目设置文件。"""
# mkdocs documentation
/site
"""/site:mkdocs 生成的静态文档目录。"""
# mypy
.mypy_cache/
.dmypy.json
dmypy.json
""".mypy_cache/、.dmypy.json 等:mypy 类型检查器的缓存文件。"""
# Pyre type checker
.pyre/
""".pyre/:Pyre 类型检查器的相关文件。"""
# pytype static type analyzer
.pytype/
""".pytype/:pytype 静态类型分析器的相关文件。"""
# Cython debug symbols
cython_debug/
"""cython_debug/:Cython 调试符号文件。"""
# PyCharm
#  JetBrains specific template is maintained in a separate JetBrains.gitignore that can
#  be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
#  and can be added to the global gitignore or merged into this file.  For a more nuclear
#  option (not recommended) you can uncomment the following to ignore the entire idea folder.
.idea/
""".idea/:PyCharm IDE 的项目配置文件。看不到就是隐藏文件"""
.DS_Store
"""macOS 操作系统生成的隐藏文件,用于存储文件夹的自定义属性,如视图选项、背景图像和其他视觉设置。这些文件通常不需要被版本控制系统(如 Git)跟踪,"""

# database migrations
*/migrations/*.py
"""这条规则用于忽略所有目录下的 migrations 子目录中的所有 Python 文件(.py)。数据库迁移文件通常用于记录数据库模式的变化,以便在不同环境中同步数据库结构。虽然这些文件可能包含重要的数据库迁移逻辑,但实际的数据库状态(如迁移文件的具体内容)通常不需要被 Git 跟踪,因为它们可以通过 makemigrations 命令重新生成。"""
!*/migrations/__init__.py
"""这条规则是一个例外规则,用于明确指定 migrations 目录中的 __init__.py 文件不应被忽略。__init__.py 文件是 Python 包的初始化文件,用于标识该目录是一个 Python 包。通常情况下,__init__.py 文件是必需的,即使在没有其他内容的情况下也是如此。"""

 

posted @ 2025-01-24 17:47  市丸银  阅读(75)  评论(0)    收藏  举报