Project to learn Django commands versioned with Git Flow.
python3 -m venv env
. env/bin/activate
pip install -r requirements.txt
To add new app:
django-admin startapp '<name_of_the_app>'
Run it:
python manage.py runserver
Create develop
branch
git checkout -b develop
git push origin develop
git branch -a
Create branch from develop
, stage and commit:
git checkout -b purepython develop
git add .
git status
git commit -m "first commit"
Merge:
git checkout develop
git merge --no-ff purepython
git push origin develop
git branch -d purepython
Change, stage, commit, merge to main
, tag, and push:
git checkout -b release-1.2
git commit -a -m "some change"
git checkout main
git merge --no-ff release-1.2
git tag -a 1.2 -m "new release 1.2"
git push --tags origin main
Merge to develop
and delete release:
git checkout develop
git merge --no-ff release-1.2
git branch -d release-1.2
Create hotfix
branch, bump version and fix the problem:
git checkout -b hotfix-1.2.1 main
./bump-version.sh 1.2.1
git commit -a -m "Bumped version number to 1.2.1"
git commit -m "Fixed severe production problem"
Merge to main
, tag and push (with tags):
git checkout main
git merge --no-ff hotfix-1.2.1
git tag -a 1.2.1
git push --tags origin main
Merge to develop
and delete branch:
git checkout develop
git merge --no-ff hotfix-1.2.1
git push --tags origin develop
git branch -d hotfix-1.2.1
Django
https://www.django-rest-framework.org/tutorial/quickstart/
https://dfpp.readthedocs.io/en/latest/chapter_01.html
Git Flow