Re: Installed Django 4.1 but version is 2.2

2023-03-21 Thread Joao Frankmann
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

On Tuesday, 21 March 2023 at 11:20:46 UTC Andréas Kühne wrote:

> 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
>
>
> Den tis 21 mars 2023 kl 11:41 skrev Joao Frankmann :
>
>> 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?
>>
>> -- 
>> 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
>>  
>> <https://groups.google.com/d/msgid/django-users/46378822-779f-4f06-be22-6f1d4241f8dbn%40googlegroups.com?utm_medium=email_source=footer>
>> .
>>
>

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/42759506-d66e-4054-a8c1-e667fea97a16n%40googlegroups.com.


Installed Django 4.1 but version is 2.2

2023-03-21 Thread Joao Frankmann


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?

-- 
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+unsubscr...@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.


Django admin only one group per user

2023-02-15 Thread Joao Frankmann
I am creating a customised Django Admin and I want to restrict users to be 
associated to no more than one group. I am using Django 4.1 and Python 3.11

admin.py:

```
from django.contrib import admin
from typing import Set

from django.contrib.auth.models import User
from django.contrib.auth.admin import UserAdmin
from django.contrib.auth.admin import UserAdmin as DjangoUserAdmin
from django.utils.translation import gettext_lazy as _

from .models import User


@admin.register(User)
class UserAdmin(DjangoUserAdmin):
ordering = ('is_staff', 'is_active', 'email', 'organisation')
list_display = ('email', 'name', 'organisation', 'is_staff', 
'is_active', 'is_superuser', 'date_joined')
fieldsets = (
("Personal info", {'fields': ('name', 'email', 'password', 
'organisation')}),
("Permissions", {'fields': (
# 'is_active',
# 'is_staff',
# 'is_superuser',
'groups',
# 'user_permissions'
)}))

add_fieldsets = (
(None, {'classes': ('wide',), 'fields': ('name', 'email', 
'password1', 'password2', 'organisation')}),
)
```

Is there a way to change this in the admin code?

Or it is possible to disable the group widget ("Choose all") on the page? 
if so which html page is used for groups?
https://i.stack.imgur.com/MyAD7.png

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/789f77e0-60e6-4664-a734-28e37e795138n%40googlegroups.com.


Re: Please help, I can't install django after a fresh installation of python 3.9 on windows 10

2021-03-19 Thread Joao Frankmann
How are you trying to install Django? Globaly? or on a Virtual Enviroment?
Try to install on a Venv.

Did you install python 3.9 in a new machine or did you have any previous 
versions installed on it?
Try to remove any previous python version installed.

Can you please post the errors here, so it could be easier to understand.

On Thursday, 18 March 2021 at 20:20:56 UTC ule...@gmail.com wrote:

> After installing python, you have to install PIP.
> To install PIP type in the following:
> python get-pip.py
>
> To install django tye in the following :
> pip install django
>
>
> Op donderdag 18 maart 2021 om 19:10:45 UTC+1 schreef 
> simmonshas...@gmail.com:
>
>> I have installed python 3.9 and selected 'add to path' during 
>> installation, i am now trying to install django 3.1.7 but it generates a 
>> lot of errors i can not understand, please what is the right way to setup 
>> django development on windows 10?
>
>

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/dd93bf97-156e-414e-a0f1-c57e656690a4n%40googlegroups.com.