Skip to content

Commit b8c14b9

Browse files
committed
user app is a go!
1 parent 659c612 commit b8c14b9

File tree

3 files changed

+103
-3
lines changed

3 files changed

+103
-3
lines changed

src/taskflow/urls.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,5 +19,5 @@
1919

2020
urlpatterns = [
2121
path("admin/", admin.site.urls),
22-
path("api/user_app/", include("user_app.urls")),
22+
path("api/user/", include("user_app.urls")),
2323
]
Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
1+
# Generated by Django 4.2.4 on 2023-08-21 01:27
2+
3+
from django.db import migrations, models
4+
import django.utils.timezone
5+
import uuid
6+
7+
8+
class Migration(migrations.Migration):
9+
10+
initial = True
11+
12+
dependencies = [
13+
("auth", "0012_alter_user_first_name_max_length"),
14+
]
15+
16+
operations = [
17+
migrations.CreateModel(
18+
name="User",
19+
fields=[
20+
("password", models.CharField(max_length=128, verbose_name="password")),
21+
(
22+
"last_login",
23+
models.DateTimeField(
24+
blank=True, null=True, verbose_name="last login"
25+
),
26+
),
27+
(
28+
"is_superuser",
29+
models.BooleanField(
30+
default=False,
31+
help_text="Designates that this user has all permissions without explicitly assigning them.",
32+
verbose_name="superuser status",
33+
),
34+
),
35+
(
36+
"is_staff",
37+
models.BooleanField(
38+
default=False,
39+
help_text="Designates whether the user can log into this admin site.",
40+
verbose_name="staff status",
41+
),
42+
),
43+
(
44+
"is_active",
45+
models.BooleanField(
46+
default=True,
47+
help_text="Designates whether this user should be treated as active. Unselect this instead of deleting accounts.",
48+
verbose_name="active",
49+
),
50+
),
51+
(
52+
"date_joined",
53+
models.DateTimeField(
54+
default=django.utils.timezone.now, verbose_name="date joined"
55+
),
56+
),
57+
(
58+
"id",
59+
models.UUIDField(
60+
default=uuid.uuid4,
61+
editable=False,
62+
primary_key=True,
63+
serialize=False,
64+
),
65+
),
66+
("email", models.EmailField(max_length=254, unique=True)),
67+
("first_name", models.CharField(max_length=200)),
68+
("last_name", models.CharField(max_length=200)),
69+
("is_verified", models.BooleanField(default=False)),
70+
("created_at", models.DateTimeField(auto_now_add=True)),
71+
(
72+
"groups",
73+
models.ManyToManyField(
74+
blank=True,
75+
help_text="The groups this user belongs to. A user will get all permissions granted to each of their groups.",
76+
related_name="user_set",
77+
related_query_name="user",
78+
to="auth.group",
79+
verbose_name="groups",
80+
),
81+
),
82+
(
83+
"user_permissions",
84+
models.ManyToManyField(
85+
blank=True,
86+
help_text="Specific permissions for this user.",
87+
related_name="user_set",
88+
related_query_name="user",
89+
to="auth.permission",
90+
verbose_name="user permissions",
91+
),
92+
),
93+
],
94+
options={
95+
"verbose_name": "user",
96+
"verbose_name_plural": "users",
97+
"abstract": False,
98+
},
99+
),
100+
]

src/user_app/signals.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
from django.utils.http import urlsafe_base64_encode
66
from django.utils.encoding import smart_bytes
77
from django.contrib.auth.tokens import default_token_generator
8-
from django.conf import DEFAULT_FROM_EMAIL
8+
from django.conf import settings
99
from django.core.mail import send_mail
1010

1111

@@ -20,7 +20,7 @@ def send_confirmation_email(sender, instance, created, **kwargs):
2020
'uid': urlsafe_base64_encode(smart_bytes(instance.pk)),
2121
'token': default_token_generator.make_token(instance),
2222
})
23-
from_email = DEFAULT_FROM_EMAIL
23+
from_email = settings.DEFAULT_FROM_EMAIL
2424
to_email = instance.email
2525
send_mail(subject, message, from_email, [to_email], fail_silently=False)
2626
except Exception as e:

0 commit comments

Comments
 (0)