Skip to content

Commit 9a35d39

Browse files
Remove .env file from Git tracking
1 parent 39c7d00 commit 9a35d39

File tree

22 files changed

+523
-55
lines changed

22 files changed

+523
-55
lines changed

.env

Lines changed: 0 additions & 9 deletions
This file was deleted.

.gitignore

15 Bytes
Binary file not shown.

account/admin.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
from django.contrib import admin
2+
3+
from account.models import User, Profile
4+
5+
6+
@admin.register(User)
7+
class UserAdmin(admin.ModelAdmin):
8+
list_display = ('username', 'email', 'first_name', 'last_name', 'is_staff', 'is_active')
9+
list_filter = ('is_staff', 'is_active', 'date_joined')
10+
search_fields = ('username', 'email', 'first_name', 'last_name')
11+
ordering = ('date_joined',)
12+
13+
14+
@admin.register(Profile)
15+
class ProfileAdmin(admin.ModelAdmin):
16+
list_display = ('user', 'location', 'birth_date')
17+
search_fields = ('user__username', 'location')
18+
list_filter = ('birth_date',)

account/emails.py

Whitespace-only changes.

account/models.py

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
from django.contrib.auth.models import AbstractUser
2+
from django.db import models
3+
4+
from .utils import profile_upload_to_unique
5+
6+
7+
class User(AbstractUser):
8+
email = models.EmailField(unique=True)
9+
10+
11+
class Profile(models.Model):
12+
user = models.OneToOneField(User, on_delete=models.CASCADE)
13+
bio = models.TextField(blank=True)
14+
location = models.CharField(max_length=100, blank=True)
15+
birth_date = models.DateField(null=True, blank=True)
16+
picture = models.ImageField(upload_to=profile_upload_to_unique, null=True, blank=True)
17+
18+
class Meta:
19+
verbose_name = "Profile"
20+
verbose_name_plural = "Profiles"
21+
indexes = [
22+
models.Index(fields=['user']),
23+
]
24+
ordering = ['user']
25+
26+
def __str__(self):
27+
return f'{self.user.username} Profile'

account/permissions.py

Whitespace-only changes.

api/serializers.py renamed to account/serializers.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
from rest_framework import serializers
22

3-
from .models import User, Profile
3+
from account.models import User, Profile
44

55

66
class UserSerializer(serializers.ModelSerializer):

account/signals.py

Whitespace-only changes.

account/templates/djoser/email/activation.html

Lines changed: 439 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
{% block subject %} Confirm your email address {% endblock %}
2+
3+
{% block plain %}
4+
Hello {{ user.username }},
5+
6+
Thank you for signing up with us!
7+
8+
To complete your registration, please confirm your email address by clicking the link below:
9+
10+
{{ activation_url }}
11+
12+
If you didn't request this, please ignore this email.
13+
14+
Thank you,
15+
Hypex Team
16+
{% endblock %}
17+
18+
{% block html %}
19+
<html lang="">
20+
<body>
21+
<h2>Hello {{ user.username }},</h2>
22+
<p>Thank you for signing up with us!</p>
23+
<p>To complete your registration, please confirm your email address by clicking the button below:</p>
24+
<a href="{{ activation_url }}"
25+
style="padding: 10px 20px; background-color: #4CAF50; color: white; text-decoration: none;">Confirm Your
26+
Email</a>
27+
<p>If you didn't request this, please ignore this email.</p>
28+
<p>Thank you,<br>Your Company Team</p>
29+
</body>
30+
</html>
31+
{% endblock %}

0 commit comments

Comments
 (0)