Fix Django migration issues and add missing URLs
- Create missing templates app urls.py - Fix REST_FRAMEWORK pagination settings - Add DEFAULT_AUTO_FIELD configuration - Create migration files for all apps - Fix auto-generated model warnings - Verify database setup with test project
This commit is contained in:
BIN
backend/apps/templates/__pycache__/__init__.cpython-314.pyc
Normal file
BIN
backend/apps/templates/__pycache__/__init__.cpython-314.pyc
Normal file
Binary file not shown.
BIN
backend/apps/templates/__pycache__/models.cpython-314.pyc
Normal file
BIN
backend/apps/templates/__pycache__/models.cpython-314.pyc
Normal file
Binary file not shown.
BIN
backend/apps/templates/__pycache__/urls.cpython-314.pyc
Normal file
BIN
backend/apps/templates/__pycache__/urls.cpython-314.pyc
Normal file
Binary file not shown.
BIN
backend/apps/templates/__pycache__/views.cpython-314.pyc
Normal file
BIN
backend/apps/templates/__pycache__/views.cpython-314.pyc
Normal file
Binary file not shown.
44
backend/apps/templates/migrations/0001_initial.py
Normal file
44
backend/apps/templates/migrations/0001_initial.py
Normal file
@@ -0,0 +1,44 @@
|
||||
# Generated by Django 5.1.4 on 2026-05-31 07:59
|
||||
|
||||
import django.db.models.deletion
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
initial = True
|
||||
|
||||
dependencies = [
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.CreateModel(
|
||||
name='CardTemplate',
|
||||
fields=[
|
||||
('id', models.CharField(max_length=50, primary_key=True, serialize=False)),
|
||||
('name', models.CharField(max_length=100)),
|
||||
('description', models.TextField()),
|
||||
('preview_image', models.ImageField(null=True, upload_to='templates/previews/')),
|
||||
('color_spade', models.CharField(default='#000000', max_length=20)),
|
||||
('color_heart', models.CharField(default='#FF0000', max_length=20)),
|
||||
('color_club', models.CharField(default='#000000', max_length=20)),
|
||||
('color_diamond', models.CharField(default='#FF0000', max_length=20)),
|
||||
('color_background', models.CharField(default='#FFFFFF', max_length=20)),
|
||||
('default_assets', models.JSONField(default=dict)),
|
||||
('created_at', models.DateTimeField(auto_now_add=True)),
|
||||
],
|
||||
options={
|
||||
'ordering': ['name'],
|
||||
},
|
||||
),
|
||||
migrations.CreateModel(
|
||||
name='SuitSymbol',
|
||||
fields=[
|
||||
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
||||
('suit_name', models.CharField(max_length=20)),
|
||||
('svg_path', models.TextField()),
|
||||
('color', models.CharField(max_length=20)),
|
||||
('template', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='suit_symbols', to='templates.cardtemplate')),
|
||||
],
|
||||
),
|
||||
]
|
||||
0
backend/apps/templates/migrations/__init__.py
Normal file
0
backend/apps/templates/migrations/__init__.py
Normal file
Binary file not shown.
Binary file not shown.
9
backend/apps/templates/urls.py
Normal file
9
backend/apps/templates/urls.py
Normal file
@@ -0,0 +1,9 @@
|
||||
from django.urls import path
|
||||
from .views import template_list, template_detail
|
||||
|
||||
app_name = 'templates'
|
||||
|
||||
urlpatterns = [
|
||||
path('templates/', template_list, name='template-list'),
|
||||
path('templates/<str:pk>/', template_detail, name='template-detail'),
|
||||
]
|
||||
Reference in New Issue
Block a user