This commit is contained in:
2025-03-13 22:08:06 +01:00
commit bab5571428
93 changed files with 4323 additions and 0 deletions

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

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

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

6
app/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
app/api/models.py Normal file
View File

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

10
app/api/routers.py Normal file
View File

@@ -0,0 +1,10 @@
from rest_framework.routers import DefaultRouter
from user.views import UserViewSet
from torrent.views import TorrentViewSet, FileViewSet
from user.views import FriendRequestViewSet
router = DefaultRouter()
router.register(r'users', UserViewSet, basename='user')
router.register(r'torrents', TorrentViewSet, basename='torrent')
router.register(r'torrent/files', FileViewSet, basename='file')
router.register(r'friend_requests', FriendRequestViewSet, basename='friend-request')

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

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

9
app/api/urls.py Normal file
View File

@@ -0,0 +1,9 @@
from django.urls import path, include
from .routers import router
app_name = "api"
urlpatterns = [
path("", include(router.urls)),
]

3
app/api/views.py Normal file
View File

@@ -0,0 +1,3 @@
from django.shortcuts import render
# Create your views here.