Note: This site is currently "Under construction". I'm migrating to a new version of my site building software. Lots of things are in a state of disrepair as a result (for example, footnote links aren't working). It's all part of the process of building in public. Most things should still be readable though.

Fixing A Wrong Old Version Of django-admin

I ran into a problem where `django-admin` wasn't working properly. It kept making projects based on an old version of django.

For example, I setup a project on my mac with:

Code

mkdir django_project
cd django_project
python3 -m venv venv
source venv/bin/activate
pip install django

The results were:

Code

Installing collected packages: sqlparse, pytz, asgiref, django
Successfully installed asgiref-3.2.10 django-3.1.2 pytz-2020.1 sqlparse-0.4.1

So, the expected 3.1.2 version is there. But, when I run:

Code

django-admin --version

I get:

Code

1.11.29

It took a while to figure out, but I finally ran `which` and got this:

Code

$ which django-admin
/usr/local/bin/django-admin

For some reason, the system version of `django-admin` was being picked up picking up even though I was inside the venv virtual environment. I have no idea what's going on there, but I deleted that old version and things worked as expected.

Code

$ which django-admin
/Users/alans/Desktop/django_project/venv/bin/django-admin

$ django-admin --version
3.1.2

Look for those old versions if you're running into a similar problem.