init
This commit is contained in:
0
app/api/__init__.py
Normal file
0
app/api/__init__.py
Normal file
3
app/api/admin.py
Normal file
3
app/api/admin.py
Normal file
@@ -0,0 +1,3 @@
|
||||
from django.contrib import admin
|
||||
|
||||
# Register your models here.
|
||||
6
app/api/apps.py
Normal file
6
app/api/apps.py
Normal file
@@ -0,0 +1,6 @@
|
||||
from django.apps import AppConfig
|
||||
|
||||
|
||||
class ApiConfig(AppConfig):
|
||||
default_auto_field = 'django.db.models.BigAutoField'
|
||||
name = 'api'
|
||||
0
app/api/migrations/__init__.py
Normal file
0
app/api/migrations/__init__.py
Normal file
3
app/api/models.py
Normal file
3
app/api/models.py
Normal file
@@ -0,0 +1,3 @@
|
||||
from django.db import models
|
||||
|
||||
# Create your models here.
|
||||
10
app/api/routers.py
Normal file
10
app/api/routers.py
Normal 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
3
app/api/tests.py
Normal file
@@ -0,0 +1,3 @@
|
||||
from django.test import TestCase
|
||||
|
||||
# Create your tests here.
|
||||
9
app/api/urls.py
Normal file
9
app/api/urls.py
Normal 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
3
app/api/views.py
Normal file
@@ -0,0 +1,3 @@
|
||||
from django.shortcuts import render
|
||||
|
||||
# Create your views here.
|
||||
Reference in New Issue
Block a user