-
Notifications
You must be signed in to change notification settings - Fork 1
[Release/2025.12] Update template project #16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
b7a0a53
b206e0c
b8bcb54
af21c8f
dc58c12
68458b2
40c8844
76d299c
be60144
a7b9e8a
f1989d0
cd76644
612efc7
f5d644b
d0d62ce
f78d010
abcd652
e165dee
31ab226
831fe16
8cad3e4
b15de8e
78b2d4c
166ae08
b134d0f
cf766b3
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| django:$2a$12$cWb4JgyAwd9BoD.4sr6mOuSg9/1vTq6JUYRZfCjSgJJmTtG3rz1FC |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| from django.contrib import admin | ||
| from django.contrib.auth.admin import UserAdmin | ||
| from .models import User | ||
|
|
||
| admin.site.register(User, UserAdmin) |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| from django.apps import AppConfig | ||
|
|
||
|
|
||
| class UserConfig(AppConfig): | ||
| name = "user" | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,120 @@ | ||
| # Generated by Django 6.0 on 2025-12-10 08:53 | ||
|
|
||
| import django.contrib.auth.models | ||
| import django.contrib.auth.validators | ||
| import django.utils.timezone | ||
| from django.db import migrations, models | ||
|
|
||
|
|
||
| class Migration(migrations.Migration): | ||
|
|
||
| initial = True | ||
|
|
||
| dependencies = [ | ||
| ("auth", "0012_alter_user_first_name_max_length"), | ||
| ] | ||
|
|
||
| operations = [ | ||
| migrations.CreateModel( | ||
| name="User", | ||
| fields=[ | ||
| ( | ||
| "id", | ||
| models.BigAutoField( | ||
| auto_created=True, | ||
| primary_key=True, | ||
| serialize=False, | ||
| verbose_name="ID", | ||
| ), | ||
| ), | ||
| ("password", models.CharField(max_length=128, verbose_name="password")), | ||
| ( | ||
| "last_login", | ||
| models.DateTimeField(blank=True, null=True, verbose_name="last login"), | ||
| ), | ||
| ( | ||
| "is_superuser", | ||
| models.BooleanField( | ||
| default=False, | ||
| help_text="Designates that this user has all permissions without explicitly assigning them.", | ||
| verbose_name="superuser status", | ||
| ), | ||
| ), | ||
| ( | ||
| "username", | ||
| models.CharField( | ||
| error_messages={"unique": "A user with that username already exists."}, | ||
| help_text="Required. 150 characters or fewer. Letters, digits and @/./+/-/_ only.", | ||
| max_length=150, | ||
| unique=True, | ||
| validators=[django.contrib.auth.validators.UnicodeUsernameValidator()], | ||
| verbose_name="username", | ||
| ), | ||
| ), | ||
| ( | ||
| "first_name", | ||
| models.CharField(blank=True, max_length=150, verbose_name="first name"), | ||
| ), | ||
| ( | ||
| "last_name", | ||
| models.CharField(blank=True, max_length=150, verbose_name="last name"), | ||
| ), | ||
| ( | ||
| "email", | ||
| models.EmailField(blank=True, max_length=254, verbose_name="email address"), | ||
| ), | ||
| ( | ||
| "is_staff", | ||
| models.BooleanField( | ||
| default=False, | ||
| help_text="Designates whether the user can log into this admin site.", | ||
| verbose_name="staff status", | ||
| ), | ||
| ), | ||
| ( | ||
| "is_active", | ||
| models.BooleanField( | ||
| default=True, | ||
| help_text="Designates whether this user should be treated as active. " | ||
| "Unselect this instead of deleting accounts.", | ||
| verbose_name="active", | ||
| ), | ||
| ), | ||
| ( | ||
| "date_joined", | ||
| models.DateTimeField(default=django.utils.timezone.now, verbose_name="date joined"), | ||
| ), | ||
| ( | ||
| "groups", | ||
| models.ManyToManyField( | ||
| blank=True, | ||
| help_text="The groups this user belongs to. A user will get all permissions granted " | ||
| "to each of their groups.", | ||
| related_name="user_set", | ||
| related_query_name="user", | ||
| to="auth.group", | ||
| verbose_name="groups", | ||
| ), | ||
| ), | ||
| ( | ||
| "user_permissions", | ||
| models.ManyToManyField( | ||
| blank=True, | ||
| help_text="Specific permissions for this user.", | ||
| related_name="user_set", | ||
| related_query_name="user", | ||
| to="auth.permission", | ||
| verbose_name="user permissions", | ||
| ), | ||
| ), | ||
| ], | ||
| options={ | ||
| "verbose_name": "user", | ||
| "verbose_name_plural": "users", | ||
| "abstract": False, | ||
| }, | ||
| managers=[ | ||
| ("objects", django.contrib.auth.models.UserManager()), | ||
| ], | ||
| ), | ||
| ] |
| Original file line number | Diff line number | Diff line change | ||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,15 @@ | ||||||||||||||||
| """ | ||||||||||||||||
| Custom user model | ||||||||||||||||
|
|
||||||||||||||||
| .. seealso:: | ||||||||||||||||
| https://docs.djangoproject.com/en/dev/topics/auth/customizing/ | ||||||||||||||||
| https://docs.djangoproject.com/en/5.2/topics/auth/customizing/#substituting-a-custom-user-model | ||||||||||||||||
| https://docs.djangoproject.com/en/5.2/topics/auth/customizing/#referencing-the-user-model | ||||||||||||||||
|
|
||||||||||||||||
| """ | ||||||||||||||||
|
|
||||||||||||||||
| from django.contrib.auth.models import AbstractUser | ||||||||||||||||
|
|
||||||||||||||||
|
|
||||||||||||||||
| class User(AbstractUser): | ||||||||||||||||
| pass | ||||||||||||||||
|
||||||||||||||||
| pass | |
| """Custom user model for this project, extending Django's ``AbstractUser``. | |
| This class currently does not add any additional fields or behavior, but | |
| serves as the central place to define project-specific user-related | |
| functionality (e.g., extra profile fields, custom managers, or methods). | |
| """ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The AppConfig class is missing the
default_auto_fieldattribute. While this will work, Django best practices recommend explicitly setting this to avoid migration warnings. Consider addingdefault_auto_field = "django.db.models.BigAutoField"to match the project's DEFAULT_AUTO_FIELD setting.