yht vor 2 Wochen
Ursprung
Commit
024d23f7d1

+ 5 - 0
pythonweb/aboutApp/admin.py

@@ -1,3 +1,8 @@
 from django.contrib import admin
+from .models import Award
 
+class AwardAdmin(admin.ModelAdmin):
+    list_display = ['description','photo']
+
+admin.site.register(Award, AwardAdmin)
 # Register your models here.

+ 22 - 0
pythonweb/aboutApp/migrations/0001_initial.py

@@ -0,0 +1,22 @@
+# Generated by Django 2.2.4 on 2026-04-21 03:44
+
+from django.db import migrations, models
+
+
+class Migration(migrations.Migration):
+
+    initial = True
+
+    dependencies = [
+    ]
+
+    operations = [
+        migrations.CreateModel(
+            name='Award',
+            fields=[
+                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
+                ('description', models.TextField(blank=True, max_length=500, null=True)),
+                ('photo', models.ImageField(blank=True, upload_to='Award/')),
+            ],
+        ),
+    ]

+ 5 - 0
pythonweb/aboutApp/models.py

@@ -1,3 +1,8 @@
 from django.db import models
 
+class Award(models.Model):
+    description = models.TextField(max_length=500,blank=True,
+                                   null=True)
+    photo = models.ImageField(upload_to='Award/',blank=True)
+
 # Create your models here.

+ 6 - 1
pythonweb/pythonweb/settings.py

@@ -84,7 +84,8 @@ WSGI_APPLICATION = 'pythonweb.wsgi.application'
 DATABASES = {
     'default': {
         'ENGINE': 'django.db.backends.sqlite3',
-        'NAME': BASE_DIR / 'db.sqlite3',
+        # 'NAME': BASE_DIR / 'db.sqlite3',
+        'NAME':os.path.join(BASE_DIR,'db.sqlite3'),
     }
 }
 
@@ -131,3 +132,7 @@ STATICFILES_DIRS = (os.path.join(BASE_DIR, "static"),)
 # https://docs.djangoproject.com/en/3.2/ref/settings/#default-auto-field
 
 DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField'
+
+
+MEDIA_URL = '/media/'
+MEDIA_ROOT = os.path.join(BASE_DIR,'media/')