Tracking development of reusable django apps with Git

Forgive me if this is not really a Django question. I made some django apps that I would like to use in other projects. I find myself needing those apps from time to time. So, I followed the instructions on this page, and turned them into pip packages. Sweet stuff.

Now I would like to continue improving those apps using Git. The question is … what should I track? No doubt, Git should track the app folder and its contents, but there are other files required for packaging (eg. MANIFEST.in, setup.cfg etc.). There are others added by setuptools. Should Git get everything or are there things that I should ignore (,gitignore)?

Any ideas?

Hi @onyeibo :wave:

So assuming that tutorial, you track the whole django_polls folder, that includes the packaging metadata (setup.cfg and so on).

You run git init in that folder, commit everything, and push it to (I’ll assume) GitHub.

Does that answer your query?

Edit: I just noticed the .gitignore part: I’d ignore .pyc files, and anything else that’s not part of the package… Some examples that come to mind are coverage files and docs builds.

I don’t use it myself but here’s GitHub’s suggested .gitignore for Python

(It has a lot I’m not interested in, but it’s a good starting point.)

HTH

1 Like

Your reply was just what I was looking for. Thank you for the advice.

1 Like

Great! Glad it was helpful! Do share the link once you get it up. :gift:

Ah @carltongibson … here they are:

  1. django-societies · PyPI
  2. django-sitewide · PyPI

They are my first PyPI contributions. Yay! … they may not be spectacular though. At least they are small reusable contributions from me (my own, and I) :slightly_smiling_face:. I hope someone finds them useful too :sweat_smile: :sweat_smile:. I created those entries before realizing that I should link them to their respective Git repositories. I will apply fixes in subsequent releases. In any case, here are direct links to their Git repos:

  1. Onyeibo / django-societies · GitLab
  2. Onyeibo / django-sitewide · GitLab

Thank you

1 Like

Great stuff! Thanks for sharing :eyes: