From 07e27b8d1ea08c28e1f65cbca58151d1965863bb Mon Sep 17 00:00:00 2001 From: saqibur Date: Thu, 14 Apr 2022 18:50:07 +0600 Subject: [PATCH] Reorganize api files --- README.md | 10 ++++++++++ apps/app_one/admin.py | 3 --- apps/app_one/{views.py => api/urls.py} | 0 apps/app_one/api/v1/tests.py | 3 --- apps/app_one/api/v2/views.py | 2 -- apps/app_one/apps.py | 6 ------ apps/app_one/models.py | 3 --- 7 files changed, 10 insertions(+), 17 deletions(-) delete mode 100644 apps/app_one/admin.py rename apps/app_one/{views.py => api/urls.py} (100%) diff --git a/README.md b/README.md index 4c43f94..768b797 100644 --- a/README.md +++ b/README.md @@ -125,6 +125,16 @@ within each relevant app, sometimes it makes more sense to build an app specifically for the API. This is where all the serializers, renderers, and views are placed. Therefore, the name of the app should reflect its API version +##### `api-versioning` +It might often be necessary to support multiple versions of an API throughout the lifetime of a project. Therefore, we're adding in support right from the start. + +For different API versions, we're assuming the following will change: +- Serializers +- Views +- URLs +- Services + +Whereas the `model`s will be shared. ### `config` * Contains project configuration files, including the primary URL file diff --git a/apps/app_one/admin.py b/apps/app_one/admin.py deleted file mode 100644 index 8c38f3f..0000000 --- a/apps/app_one/admin.py +++ /dev/null @@ -1,3 +0,0 @@ -from django.contrib import admin - -# Register your models here. diff --git a/apps/app_one/views.py b/apps/app_one/api/urls.py similarity index 100% rename from apps/app_one/views.py rename to apps/app_one/api/urls.py diff --git a/apps/app_one/api/v1/tests.py b/apps/app_one/api/v1/tests.py index 7ce503c..e69de29 100644 --- a/apps/app_one/api/v1/tests.py +++ b/apps/app_one/api/v1/tests.py @@ -1,3 +0,0 @@ -from django.test import TestCase - -# Create your tests here. diff --git a/apps/app_one/api/v2/views.py b/apps/app_one/api/v2/views.py index d3ab8cf..e69de29 100644 --- a/apps/app_one/api/v2/views.py +++ b/apps/app_one/api/v2/views.py @@ -1,2 +0,0 @@ -APIView -def does one thing \ No newline at end of file diff --git a/apps/app_one/apps.py b/apps/app_one/apps.py index ed327d2..e69de29 100644 --- a/apps/app_one/apps.py +++ b/apps/app_one/apps.py @@ -1,6 +0,0 @@ -from django.apps import AppConfig - - -class AppConfig(AppConfig): - default_auto_field = 'django.db.models.BigAutoField' - name = 'app' diff --git a/apps/app_one/models.py b/apps/app_one/models.py index 71a8362..e69de29 100644 --- a/apps/app_one/models.py +++ b/apps/app_one/models.py @@ -1,3 +0,0 @@ -from django.db import models - -# Create your models here.