Installed Django 4.1 but version is 2.2

21 views
Skip to first unread message

Joao Frankmann

unread,
Mar 21, 2023, 6:41:07 AM3/21/23
to Django users

I've been using django for a while and today when starting a new project I noticed that when I run:

django-admin startproject mysite

The settings.py generated file says:

Generated by 'django-admin startproject' using Django 2.2.19

and the code is not the new one. I have projects written in django 4 and in django 2 and the code generated is equal to the django 2

I also ran:

python -m django --version

which returns:

4.1.7

Python version is 3.11

Anyone else have this issue?

Andréas Kühne

unread,
Mar 21, 2023, 7:20:46 AM3/21/23
to django...@googlegroups.com
I am guessing this is because you are running your systems installed django-admin for setting up the project and not in a virtualenvironment?

Before running django-admin startproject mysite, make sure that you have created a virtualenvironment and install the version of django that you want.

Regards,

Andréas


--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/46378822-779f-4f06-be22-6f1d4241f8dbn%40googlegroups.com.

Joao Frankmann

unread,
Mar 21, 2023, 7:37:39 AM3/21/23
to Django users
I am running on a containerised virtual environment completely isolated to the system.
when I run django --version, it shows me the version 4.1, but when I check the code, it is not the code for 4.1 but the code for 2.2

Reply all
Reply to author
Forward
0 new messages