Last active
October 27, 2024 17:16
-
-
Save santoshpy/6f982faf1eacdac153ffd86a3a694239 to your computer and use it in GitHub Desktop.
gitignore file for django project
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Byte-compiled / optimized / DLL files | |
__pycache__/ | |
*.py[cod] | |
*$py.class | |
# C extensions | |
*.so | |
# Distribution / packaging | |
.Python | |
env/ | |
build/ | |
develop-eggs/ | |
dist/ | |
downloads/ | |
eggs/ | |
.eggs/ | |
lib/ | |
lib64/ | |
parts/ | |
sdist/ | |
var/ | |
wheels/ | |
*.egg-info/ | |
.installed.cfg | |
*.egg | |
# 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 | |
# Installer logs | |
pip-log.txt | |
pip-delete-this-directory.txt | |
# Unit test / coverage reports | |
htmlcov/ | |
.tox/ | |
.coverage | |
.coverage.* | |
.cache | |
nosetests.xml | |
coverage.xml | |
*.cover | |
.hypothesis/ | |
# Translations | |
*.mo | |
*.pot | |
# Django stuff: | |
*.log | |
local_settings.py | |
# Flask stuff: | |
instance/ | |
.webassets-cache | |
# Scrapy stuff: | |
.scrapy | |
# Sphinx documentation | |
docs/_build/ | |
# PyBuilder | |
target/ | |
# Jupyter Notebook | |
.ipynb_checkpoints | |
# pyenv | |
.python-version | |
# celery beat schedule file | |
celerybeat-schedule | |
# SageMath parsed files | |
*.sage.py | |
# dotenv | |
.env | |
# virtualenv | |
.venv | |
venv/ | |
ENV/ | |
.vscode | |
# Spyder project settings | |
.spyderproject | |
.spyproject | |
# Rope project settings | |
.ropeproject | |
# mkdocs documentation | |
/site | |
# mypy | |
.mypy_cache/ | |
.DS_Store | |
*.sqlite3 | |
media/ | |
*.pyc | |
*.db | |
*.pid | |
# Ignore Django Migrations in Development if you are working on team | |
# Only for Development only | |
# **/migrations/** | |
# !**/migrations | |
# !**/migrations/__init__.py |
to be more precise they are /py_cache files and venv/lib/python/site-packages/ but i notice that you ignore the venv folder , we use a common venv in my team to not flood our machines and it works fine
What do you mean by common venv? In general, you should ignore your
environment and only keep a requirements.txt file in tracking.
I'll explicitly state how you can create a requirements file.
1. Activate your environment
2. pip freeze > requirements.txt
In your gitignore just add
<name of environment>/
And now add this to tracking
3. git add requirements.txt .gitignore
4. git commit -m 'adding requirements'
5. git push origin master
Now anyone who pulls the repo can (optionally) create their own environment
and install the requirements using
pip install -r requirements.txt
Hope this helps!
…On Fri, 8 Jan, 2021, 10:42 pm MrKyHn1, ***@***.***> wrote:
***@***.**** commented on this gist.
------------------------------
to be more precise they are */py_cache files and venv/lib/python*/site-packages/
but i notice that you ignore the venv folder , we use a common venv in my
team to not flood our machines and it works fine
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<https://gist.github.com/6f982faf1eacdac153ffd86a3a694239#gistcomment-3587135>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ALDOFXMA3YS5HHNDY7ABREDSY44I3ANCNFSM4PW5IOZQ>
.
I mean the venv is on the repo when you clone it. I am gonna remove it like suggested, but i would like to make a script to create the venv( i mean the activate/deactivate/... Binaries and so on)
I do it all the time. I mostly use windows. Here's my bat file that does
some stuff for me:
```
@echo off
py -m venv env
type nul > env.bat
echo cd env\Scripts >> env.bat
echo call activate.bat >> env.bat
echo cd ..\.. >> env.bat
call env.bat
```
I have added the location of this bat file in my Environment variables.
Then I call it in whichever folder I want to create a new environment.
…On Fri, Jan 8, 2021 at 11:33 PM MrKyHn1 ***@***.***> wrote:
***@***.**** commented on this gist.
------------------------------
I mean the venv is on the repo when you clone it. I am gonna remove it
like suggested, but i would like to make a script to create the venv( i
mean the activate/deactivate/... Binaries and so on)
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<https://gist.github.com/6f982faf1eacdac153ffd86a3a694239#gistcomment-3587208>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ALDOFXLC7W4TSSLWE5YOFQTSY5CHBANCNFSM4PW5IOZQ>
.
Thanks a lot! Have a nice evening :)
Thank you so much this is really helpful...
thanks!
It's great, thanks!
Thanks it is really useful!
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hello, i have site-packages and py_cache files, should i ignore them on my gitignore, besides poluting my git status i feel like it is not necessary files, they should only remain on the user's side. What do you guys think ?