Initialize Fonrey Django multi-tenant project skeleton

Set up the required directory layout, app scaffolding, core settings, templates, static assets, and Docker/Tailwind tooling to establish a standardized development baseline.
This commit is contained in:
2026-04-26 17:12:09 +08:00
commit 4aba6dfa77
170 changed files with 1220 additions and 0 deletions

0
apps/tenant/__init__.py Normal file
View File

1
apps/tenant/admin.py Normal file
View File

@@ -0,0 +1 @@
from django.contrib import admin

6
apps/tenant/apps.py Normal file
View File

@@ -0,0 +1,6 @@
from django.apps import AppConfig
class TenantConfig(AppConfig):
name = "apps.tenant"
verbose_name = "租户管理"

23
apps/tenant/models.py Normal file
View File

@@ -0,0 +1,23 @@
from django.db import models
from django_tenants.models import DomainMixin, TenantMixin
class Tenant(TenantMixin):
name = models.CharField(max_length=100)
created_at = models.DateTimeField(auto_now_add=True)
updated_at = models.DateTimeField(auto_now=True)
auto_create_schema = True
class Meta:
verbose_name = "租户"
verbose_name_plural = "租户"
def __str__(self) -> str:
return self.name
class Domain(DomainMixin):
class Meta:
verbose_name = "租户域名"
verbose_name_plural = "租户域名"

View File

View File

6
apps/tenant/tasks.py Normal file
View File

@@ -0,0 +1,6 @@
from celery import shared_task
@shared_task
def sample_task() -> str:
return "tenant task placeholder"

View File

View File

9
apps/tenant/urls.py Normal file
View File

@@ -0,0 +1,9 @@
from django.urls import path
from . import views
app_name = "tenant"
urlpatterns = [
path("", views.index, name="index"),
]

5
apps/tenant/views.py Normal file
View File

@@ -0,0 +1,5 @@
from django.http import HttpRequest, HttpResponse
def index(request: HttpRequest) -> HttpResponse:
return HttpResponse("tenant app placeholder")