Question: I'm ready to push my existing Django project (which i've been running in a local environment) to a Bitbucket repository so I can run it on a public server. At the moment I feel like there's a lot of files created in local development that needs to be added to `.gitignore`. 

I found [this `.gitignore` file on github](https://github.com/github/gitignore/blob/master/Python.gitignore) however I still feel it's missing some things, for example it doesn't seem to remove files from each `migrations` folders. There's also a lot of stuff there that I don't know what they do - I understand not all of it is needed. Any advice is appreciated.

Answer: 
You could consider a [`gitignore` tailored for Django project](https://github.com/django/django/blob/master/.gitignore) instead.

And don't forget that, if you already have added and committed a folder content, you will need to remove them before your .gitignore can take effect.

```
git rm --cached -r afolder/

```

However, by default, `migration` is not ignored. (you can [skip some of those migration steps](https://stackoverflow.com/q/31369466/6309))  

As pointed out by [Ora](https://stackoverflow.com/users/9032857/ora) in the comments, see "[Should I be adding the Django migration files in the `.gitignore` file?](https://stackoverflow.com/q/28035119/6309)".

So, do not add `migration/` to your `.gitignore`.
I actually don't know how did you add `migrations` directories. If you already committed to git with those directories, then simply add `migrations/*` to `.gitignore` and delete all the migrations folder. Then commit and push. After this, you will never see any `migrations` changes to git until you forcefully staged and commit.