1

Recently I have tried cloning my production code to a different pc. Then I have connected my project to a blank DB and run the command python manage.py makemigrations and after that, I can see that my migrations folder was updated with some __pycache__ files. URL: /folder/app/migrations/pycache I know that the migrations files are very important but here the problem is the production DB contains data and the DB in that different PC is empty. I think if I push these __pycache__ files to the production it might create conflict.

My idea is not to push these pycache files(/folder/app/migrations/pycache) into my production environment and ignore them using the gitignore(as I am using git for version control).

Am I doing the right thing?

and Should/can I gitignore all the __pycache__ files from the project.

web_codr
  • 13
  • 5

1 Answers1

0

Add below line in your .gitignore file to avoid Byte Compiled File in Python

**/__pycache__
*.pyc

Please make sure that your folders not already tracked.

Sabil
  • 3,750
  • 1
  • 5
  • 16