Should I commit static files into Git repo with Django project?

Viewed 1323

Should I commit and push my Django's project static files into my git repo? I know there is collectstatic command but it's just for prod deployment right?

I work on the same project from 2 different computers and then, I have static files in one that I don't have on the other.

Am I supposed to collectstatic from one to the other? But I don't understand this command neither how to use it nor what it does.

Thank you for helping.

Best regards.

1 Answers

Yes, normally we commit static files.

The command collectstatic just copies the static files from the individual app folders into one general folder (normally used only in PROD server).

But the static files should already be present (and committed) in the individual app folders, so that each development PC and also the PROD server have the same static files present.

Related