dockerfile, api: Yangi loyiha uchun Dockerfile va Django API modullarini qo'shish. Kiritilgan fayllar: requirements.txt, admin.py, models.py, tests.py va boshqalar.

This commit is contained in:
A'zamov Samandar
2025-04-19 17:45:12 +05:00
parent e5b57671c8
commit 098dce9fdb
18 changed files with 235 additions and 0 deletions

0
template/api/__init__.py Normal file
View File

3
template/api/admin.py Normal file
View File

@@ -0,0 +1,3 @@
from django.contrib import admin
# Register your models here.

6
template/api/apps.py Normal file
View File

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

View File

3
template/api/models.py Normal file
View File

@@ -0,0 +1,3 @@
from django.db import models
# Create your models here.

3
template/api/tests.py Normal file
View File

@@ -0,0 +1,3 @@
from django.test import TestCase
# Create your tests here.

6
template/api/urls.py Normal file
View File

@@ -0,0 +1,6 @@
from django.urls import path
from .views import HealthView
urlpatterns = [
path("health/", HealthView.as_view())
]

7
template/api/views.py Normal file
View File

@@ -0,0 +1,7 @@
from rest_framework.views import APIView
from rest_framework.response import Response
class HealthView(APIView):
def get(self, *args, **kwargs):
return Response(data={"detail": "OK"})