gold eggs backend
Some checks failed
Build and Push to Docker Hub / build-test-push (push) Failing after 1m55s

This commit is contained in:
2026-04-15 08:59:36 +02:00
commit ab73d05ecc
359 changed files with 14415 additions and 0 deletions

0
core/apps/home/__init__.py Executable file
View File

View File

6
core/apps/home/apps.py Executable file
View File

@@ -0,0 +1,6 @@
from django.apps import AppConfig
class HomeConfig(AppConfig):
default_auto_field = "django.db.models.BigAutoField"
name = "core.apps.home"

View File

View File

View File

23
core/apps/home/urls.py Executable file
View File

@@ -0,0 +1,23 @@
"""
Home app urls
"""
from django.urls import path
from django.urls import include
from rest_framework import routers
from core.apps.home import views
router = routers.DefaultRouter()
router.register("", views.PostListView, basename="posts")
urlpatterns = [
path(
"messages/",
views.FrontendTranslationView.as_view(),
name="frontend-translation",
), # noqa
path("posts/", include(router.urls), name="posts"),
path("", views.HomeView.as_view(), name="home"),
]

View File

@@ -0,0 +1,3 @@
from .frontend import * # noqa
from .home import * # noqa
from .post import * # noqa

View File

@@ -0,0 +1,32 @@
"""
Admin panel UI view
"""
from rest_framework import status
from rest_framework import generics
from core.http import views
from core.http import models
from core.http import serializers
class FrontendTranslationView(generics.ListAPIView, views.ApiResponse):
queryset = models.FrontendTranslation.objects.all()
serializer_class = serializers.FrontendTransactionSerializer
def get(self, request, **kwargs):
serializer = self.get_serializer(self.get_queryset(), many=True)
data = {}
for obj in serializer.data:
data[obj["key"]] = obj["value"]
return self.success(data=data, status=status.HTTP_200_OK)
def get_queryset(self):
queryset = self.queryset.all()
key = self.request.GET.get("key")
if key:
queryset = queryset.filter(key__icontains=key)
return queryset

View File

@@ -0,0 +1,7 @@
from django import views
from django import shortcuts
class HomeView(views.View):
def get(self, request):
return shortcuts.render(request, "user/home.html")

View File

@@ -0,0 +1,12 @@
from rest_framework import viewsets
from core.http import models
from core.http import serializers
class PostListView(viewsets.ModelViewSet):
queryset = models.Post.objects.all()
serializer_class = serializers.PostSerializer
def dispatch(self, request, *args, **kwargs):
return super().dispatch(request, *args, **kwargs)