django-mz-users 0.1.0a1__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Miroslav Zvolský
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,65 @@
1
+ Metadata-Version: 2.4
2
+ Name: django-mz-users
3
+ Version: 0.1.0a1
4
+ Summary: Custom user model and user management for Django projects of the django-mz family
5
+ Keywords: django,users,user-model,auth,accounts
6
+ Author: Miroslav Zvolský
7
+ Author-email: Miroslav Zvolský <zvolsky@seznam.cz>
8
+ License-Expression: MIT
9
+ License-File: LICENSE
10
+ Classifier: Development Status :: 3 - Alpha
11
+ Classifier: Framework :: Django
12
+ Classifier: Framework :: Django :: 5.2
13
+ Classifier: Framework :: Django :: 6.0
14
+ Classifier: Intended Audience :: Developers
15
+ Classifier: Operating System :: OS Independent
16
+ Classifier: Programming Language :: Python :: 3
17
+ Classifier: Programming Language :: Python :: 3.12
18
+ Classifier: Programming Language :: Python :: 3.13
19
+ Classifier: Topic :: Software Development :: Libraries
20
+ Requires-Dist: django>=5.2
21
+ Requires-Python: >=3.12
22
+ Description-Content-Type: text/markdown
23
+
24
+ # django-mz-users
25
+
26
+ The user model and user management for Django projects of the **django-mz** family (projects whose admin drives
27
+ an API and a Vue frontend). It is a small, plain Django app that any project can use.
28
+
29
+ > Status: alpha (0.1.0a1). The API may change before 1.0.
30
+
31
+ ## Why a custom user model from the start
32
+
33
+ Django recommends a custom user model for every new project: switching `AUTH_USER_MODEL` later, on a live
34
+ database, is hard. `mz_users.User` is Django's standard user (`AbstractUser`) in its own app, so projects can share
35
+ it and extend it later without that switch.
36
+
37
+ ## Installation
38
+
39
+ ```console
40
+ pip install django-mz-users
41
+ ```
42
+
43
+ ```python
44
+ INSTALLED_APPS = [..., 'django.contrib.auth', 'mz_users', ...]
45
+ AUTH_USER_MODEL = 'mz_users.User'
46
+ ```
47
+
48
+ Set it before the first `migrate` of the project. The app label is `mz_users` (table `mz_users_user`).
49
+
50
+ ## What is included
51
+
52
+ - `mz_users.User` – the user model (`AbstractUser`), Czech labels included
53
+ - admin registration with Django's `UserAdmin`: the new-user form asks for the password twice
54
+
55
+ Planned: self-registration, password reset by e-mail and other user management, as API views for the frontend.
56
+
57
+ ## Development
58
+
59
+ ```console
60
+ uv run --package django-mz-users pytest
61
+ ```
62
+
63
+ ## License
64
+
65
+ MIT
@@ -0,0 +1,42 @@
1
+ # django-mz-users
2
+
3
+ The user model and user management for Django projects of the **django-mz** family (projects whose admin drives
4
+ an API and a Vue frontend). It is a small, plain Django app that any project can use.
5
+
6
+ > Status: alpha (0.1.0a1). The API may change before 1.0.
7
+
8
+ ## Why a custom user model from the start
9
+
10
+ Django recommends a custom user model for every new project: switching `AUTH_USER_MODEL` later, on a live
11
+ database, is hard. `mz_users.User` is Django's standard user (`AbstractUser`) in its own app, so projects can share
12
+ it and extend it later without that switch.
13
+
14
+ ## Installation
15
+
16
+ ```console
17
+ pip install django-mz-users
18
+ ```
19
+
20
+ ```python
21
+ INSTALLED_APPS = [..., 'django.contrib.auth', 'mz_users', ...]
22
+ AUTH_USER_MODEL = 'mz_users.User'
23
+ ```
24
+
25
+ Set it before the first `migrate` of the project. The app label is `mz_users` (table `mz_users_user`).
26
+
27
+ ## What is included
28
+
29
+ - `mz_users.User` – the user model (`AbstractUser`), Czech labels included
30
+ - admin registration with Django's `UserAdmin`: the new-user form asks for the password twice
31
+
32
+ Planned: self-registration, password reset by e-mail and other user management, as API views for the frontend.
33
+
34
+ ## Development
35
+
36
+ ```console
37
+ uv run --package django-mz-users pytest
38
+ ```
39
+
40
+ ## License
41
+
42
+ MIT
@@ -0,0 +1,50 @@
1
+ [project]
2
+ name = "django-mz-users"
3
+ version = "0.1.0a1"
4
+ description = "Custom user model and user management for Django projects of the django-mz family"
5
+ readme = "README.md"
6
+ license = "MIT"
7
+ license-files = ["LICENSE"]
8
+ requires-python = ">=3.12"
9
+ dependencies = ["django>=5.2"]
10
+ keywords = [
11
+ "django",
12
+ "users",
13
+ "user-model",
14
+ "auth",
15
+ "accounts",
16
+ ]
17
+ classifiers = [
18
+ "Development Status :: 3 - Alpha",
19
+ "Framework :: Django",
20
+ "Framework :: Django :: 5.2",
21
+ "Framework :: Django :: 6.0",
22
+ "Intended Audience :: Developers",
23
+ "Operating System :: OS Independent",
24
+ "Programming Language :: Python :: 3",
25
+ "Programming Language :: Python :: 3.12",
26
+ "Programming Language :: Python :: 3.13",
27
+ "Topic :: Software Development :: Libraries",
28
+ ]
29
+
30
+ [[project.authors]]
31
+ name = "Miroslav Zvolský"
32
+ email = "zvolsky@seznam.cz"
33
+
34
+ [dependency-groups]
35
+ dev = [
36
+ "pytest>=8",
37
+ "pytest-django>=4.9",
38
+ ]
39
+
40
+ [build-system]
41
+ requires = ["uv_build>=0.12.13,<0.13.0"]
42
+ build-backend = "uv_build"
43
+
44
+ [tool.uv.build-backend]
45
+ module-name = "mz_users"
46
+
47
+ [tool.pytest.ini_options]
48
+ DJANGO_SETTINGS_MODULE = "tests.settings"
49
+ pythonpath = ["."]
50
+ testpaths = ["tests"]
@@ -0,0 +1,45 @@
1
+ [project]
2
+ name = "django-mz-users"
3
+ version = "0.1.0a1"
4
+ description = "Custom user model and user management for Django projects of the django-mz family"
5
+ readme = "README.md"
6
+ license = "MIT"
7
+ license-files = ["LICENSE"]
8
+ authors = [
9
+ { name = "Miroslav Zvolský", email = "zvolsky@seznam.cz" }
10
+ ]
11
+ requires-python = ">=3.12"
12
+ dependencies = [
13
+ "django>=5.2",
14
+ ]
15
+ keywords = ["django", "users", "user-model", "auth", "accounts"]
16
+ classifiers = [
17
+ "Development Status :: 3 - Alpha",
18
+ "Framework :: Django",
19
+ "Framework :: Django :: 5.2",
20
+ "Framework :: Django :: 6.0",
21
+ "Intended Audience :: Developers",
22
+ "Operating System :: OS Independent",
23
+ "Programming Language :: Python :: 3",
24
+ "Programming Language :: Python :: 3.12",
25
+ "Programming Language :: Python :: 3.13",
26
+ "Topic :: Software Development :: Libraries",
27
+ ]
28
+
29
+ [dependency-groups]
30
+ dev = [
31
+ "pytest>=8",
32
+ "pytest-django>=4.9",
33
+ ]
34
+
35
+ [build-system]
36
+ requires = ["uv_build>=0.12.13,<0.13.0"]
37
+ build-backend = "uv_build"
38
+
39
+ [tool.uv.build-backend]
40
+ module-name = "mz_users"
41
+
42
+ [tool.pytest.ini_options]
43
+ DJANGO_SETTINGS_MODULE = "tests.settings"
44
+ pythonpath = ["."]
45
+ testpaths = ["tests"]
@@ -0,0 +1 @@
1
+ """Custom user model and user management for Django projects of the django-mz family."""
@@ -0,0 +1,7 @@
1
+ from django.contrib import admin
2
+ from django.contrib.auth.admin import UserAdmin
3
+
4
+ from .models import User
5
+
6
+ # the new-user form of UserAdmin asks for the password twice (fields of the form only, not of the model)
7
+ admin.site.register(User, UserAdmin)
@@ -0,0 +1,9 @@
1
+ from django.apps import AppConfig
2
+ from django.utils.translation import gettext_lazy as _
3
+
4
+
5
+ class MzUsersConfig(AppConfig):
6
+ name = 'mz_users'
7
+ label = 'mz_users'
8
+ verbose_name = _('Users')
9
+ default_auto_field = 'django.db.models.BigAutoField'
@@ -0,0 +1,17 @@
1
+ msgid ""
2
+ msgstr ""
3
+ "Project-Id-Version: django-mz-users\n"
4
+ "Language: cs\n"
5
+ "MIME-Version: 1.0\n"
6
+ "Content-Type: text/plain; charset=UTF-8\n"
7
+ "Content-Transfer-Encoding: 8bit\n"
8
+ "Plural-Forms: nplurals=4; plural=(n == 1 && n % 1 == 0) ? 0 : (n >= 2 && n <= 4 && n % 1 == 0) ? 1: (n % 1 != 0 ) ? 2 : 3;\n"
9
+
10
+ msgid "Users"
11
+ msgstr "Uživatelé"
12
+
13
+ msgid "user"
14
+ msgstr "uživatel"
15
+
16
+ msgid "users"
17
+ msgstr "uživatelé"
@@ -0,0 +1,45 @@
1
+ # Generated by Django 6.1.1 on 2026-11-02 16:08
2
+
3
+ import django.contrib.auth.models
4
+ import django.contrib.auth.validators
5
+ import django.utils.timezone
6
+ from django.db import migrations, models
7
+
8
+
9
+ class Migration(migrations.Migration):
10
+
11
+ initial = True
12
+
13
+ dependencies = [
14
+ ('auth', '0012_alter_user_first_name_max_length'),
15
+ ]
16
+
17
+ operations = [
18
+ migrations.CreateModel(
19
+ name='User',
20
+ fields=[
21
+ ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
22
+ ('password', models.CharField(max_length=128, verbose_name='password')),
23
+ ('last_login', models.DateTimeField(blank=True, null=True, verbose_name='last login')),
24
+ ('is_superuser', models.BooleanField(default=False, help_text='Designates that this user has all permissions without explicitly assigning them.', verbose_name='superuser status')),
25
+ ('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')),
26
+ ('first_name', models.CharField(blank=True, max_length=150, verbose_name='first name')),
27
+ ('last_name', models.CharField(blank=True, max_length=150, verbose_name='last name')),
28
+ ('email', models.EmailField(blank=True, max_length=254, verbose_name='email address')),
29
+ ('is_staff', models.BooleanField(default=False, help_text='Designates whether the user can log into this admin site.', verbose_name='staff status')),
30
+ ('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')),
31
+ ('date_joined', models.DateTimeField(default=django.utils.timezone.now, verbose_name='date joined')),
32
+ ('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')),
33
+ ('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')),
34
+ ],
35
+ options={
36
+ 'verbose_name': 'user',
37
+ 'verbose_name_plural': 'users',
38
+ 'abstract': False,
39
+ 'swappable': 'AUTH_USER_MODEL',
40
+ },
41
+ managers=[
42
+ ('objects', django.contrib.auth.models.UserManager()),
43
+ ],
44
+ ),
45
+ ]
@@ -0,0 +1,14 @@
1
+ """
2
+ The project's user model (``AUTH_USER_MODEL = 'mz_users.User'``). It starts as Django's standard user, so a project
3
+ can later add fields or behaviour here without the painful switch of the user model on a live database.
4
+ """
5
+
6
+ from django.contrib.auth.models import AbstractUser
7
+ from django.utils.translation import gettext_lazy as _
8
+
9
+
10
+ class User(AbstractUser):
11
+ class Meta(AbstractUser.Meta):
12
+ swappable = 'AUTH_USER_MODEL'
13
+ verbose_name = _('user')
14
+ verbose_name_plural = _('users')
File without changes