init new apps

This commit is contained in:
2025-09-05 11:34:31 +02:00
parent cc2fe5ed03
commit ac1649fbbb
17 changed files with 125 additions and 0 deletions
View File
+3
View File
@@ -0,0 +1,3 @@
from django.contrib import admin
# Register your models here.
+5
View File
@@ -0,0 +1,5 @@
from django.apps import AppConfig
class ProfilesConfig(AppConfig):
name = 'profiles'
+25
View File
@@ -0,0 +1,25 @@
# Generated by Django 3.0 on 2025-09-04 15:36
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
]
operations = [
migrations.CreateModel(
name='Profile',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('favorite_city', models.CharField(blank=True, max_length=64)),
('user', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
],
),
]
View File
+11
View File
@@ -0,0 +1,11 @@
from django.db import models
from django.contrib.auth.models import User
class Profile(models.Model):
user = models.OneToOneField(User, on_delete=models.CASCADE)
favorite_city = models.CharField(max_length=64, blank=True)
def __str__(self):
return self.user.username
+3
View File
@@ -0,0 +1,3 @@
from django.test import TestCase
# Create your tests here.
+3
View File
@@ -0,0 +1,3 @@
from django.shortcuts import render
# Create your views here.