init
This commit is contained in:
@@ -0,0 +1,3 @@
|
||||
from django.contrib import admin
|
||||
|
||||
# Register your models here.
|
||||
@@ -0,0 +1,6 @@
|
||||
from django.apps import AppConfig
|
||||
|
||||
|
||||
class ApiConfig(AppConfig):
|
||||
default_auto_field = 'django.db.models.BigAutoField'
|
||||
name = 'api'
|
||||
@@ -0,0 +1,3 @@
|
||||
from django.db import models
|
||||
|
||||
# Create your models here.
|
||||
@@ -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')
|
||||
@@ -0,0 +1,3 @@
|
||||
from django.test import TestCase
|
||||
|
||||
# Create your tests here.
|
||||
@@ -0,0 +1,9 @@
|
||||
|
||||
from django.urls import path, include
|
||||
|
||||
from .routers import router
|
||||
|
||||
app_name = "api"
|
||||
urlpatterns = [
|
||||
path("", include(router.urls)),
|
||||
]
|
||||
@@ -0,0 +1,3 @@
|
||||
from django.shortcuts import render
|
||||
|
||||
# Create your views here.
|
||||
Reference in New Issue
Block a user