Skip to content

Commit 27eaa3c

Browse files
committed
Theme Customizer feature added.
Update on the UI and Feature update of Theme Customizer.
1 parent 29fe317 commit 27eaa3c

File tree

24 files changed

+279
-2387
lines changed

24 files changed

+279
-2387
lines changed
70 Bytes
Binary file not shown.

Base_Master/urls.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,5 @@
1111
path('profile/', views.profile, name="profile"),
1212
path('update/<str:id>/', views.update, name="update"),
1313
path('disable/<str:id>/', views.disable_user, name="disable_user"),
14+
path('theme', views.theme, name="theme"),
1415
]

db.sqlite3

8 KB
Binary file not shown.
151 Bytes
Binary file not shown.
786 Bytes
Binary file not shown.
2.06 KB
Binary file not shown.

firstapp/admin.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
from django.contrib import admin
2-
2+
from firstapp.models import Theme
33
# Register your models here.
4+
admin.site.register(Theme)
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# Generated by Django 4.0.4 on 2023-03-04 09:27
2+
3+
from django.conf import settings
4+
from django.db import migrations, models
5+
import django.db.models.deletion
6+
7+
8+
class Migration(migrations.Migration):
9+
10+
initial = True
11+
12+
dependencies = [
13+
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
14+
]
15+
16+
operations = [
17+
migrations.CreateModel(
18+
name='Theme',
19+
fields=[
20+
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
21+
('color', models.CharField(choices=[('dark', 'dark'), ('light', 'light')], default='light', max_length=15)),
22+
('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
23+
],
24+
),
25+
]
1.42 KB
Binary file not shown.

firstapp/models.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,13 @@
11
from django.db import models
2-
2+
from django.contrib.auth.models import User
33
# Create your models here.
4+
themes = (
5+
("dark", "dark"),
6+
("light", "light"),
7+
)
8+
class Theme(models.Model):
9+
user = models.ForeignKey(User, on_delete=models.CASCADE)
10+
color = models.CharField(choices=themes, default="light", max_length=15)
11+
12+
def __str__(self):
13+
return self.user.username

0 commit comments

Comments
 (0)