First commit of claude's rework in django + vanillajs fronted

This commit is contained in:
Gérald Colangelo
2026-04-02 11:24:30 +02:00
parent 7710a876df
commit fde92f92db
163 changed files with 84852 additions and 15 deletions

31
apps/users/models.py Normal file
View File

@@ -0,0 +1,31 @@
from django.contrib.auth.models import AbstractUser
from django.db import models
LANGUAGE_CHOICES = [
('en', 'English'),
('fr', 'Français'),
('de', 'Deutsch'),
('es', 'Español'),
]
class User(AbstractUser):
"""
Custom user model — kept intentionally thin so the schema can evolve.
Authentication is handled by dj-rest-auth + allauth (JWT + external IDP).
"""
email = models.EmailField(unique=True)
avatar = models.ForeignKey(
'photos.Photo',
null=True, blank=True,
on_delete=models.SET_NULL,
related_name='avatar_user',
)
language = models.CharField(max_length=5, choices=LANGUAGE_CHOICES, default='en', verbose_name='language')
USERNAME_FIELD = 'email'
REQUIRED_FIELDS = ['username']
def __str__(self):
return self.email