From 3d69b2906702025ef40bd6037279a91f971255d4 Mon Sep 17 00:00:00 2001 From: Pratyush Desai Date: Fri, 24 Dec 2021 20:44:01 +0530 Subject: add apps, basic routing, req.txt --- api/api/analytics/__init__.py | 0 api/api/analytics/__pycache__/__init__.cpython-310.pyc | Bin 0 -> 151 bytes api/api/analytics/__pycache__/admin.cpython-310.pyc | Bin 0 -> 192 bytes api/api/analytics/__pycache__/apps.cpython-310.pyc | Bin 0 -> 436 bytes api/api/analytics/__pycache__/models.cpython-310.pyc | Bin 0 -> 189 bytes api/api/analytics/admin.py | 3 +++ api/api/analytics/apps.py | 6 ++++++ api/api/analytics/migrations/__init__.py | 0 api/api/analytics/models.py | 3 +++ api/api/analytics/tests.py | 3 +++ api/api/analytics/views.py | 3 +++ api/api/api/__pycache__/__init__.cpython-310.pyc | Bin 0 -> 145 bytes api/api/api/__pycache__/settings.cpython-310.pyc | Bin 0 -> 2305 bytes api/api/api/settings.py | 2 ++ api/api/api/urls.py | 4 +++- api/api/blogs/__init__.py | 0 api/api/blogs/admin.py | 3 +++ api/api/blogs/apps.py | 6 ++++++ api/api/blogs/migrations/__init__.py | 0 api/api/blogs/models.py | 4 ++++ api/api/blogs/tests.py | 3 +++ api/api/blogs/urls.py | 6 ++++++ api/api/blogs/views.py | 7 +++++++ api/requirements.txt | 5 +++++ 24 files changed, 57 insertions(+), 1 deletion(-) create mode 100644 api/api/analytics/__init__.py create mode 100644 api/api/analytics/__pycache__/__init__.cpython-310.pyc create mode 100644 api/api/analytics/__pycache__/admin.cpython-310.pyc create mode 100644 api/api/analytics/__pycache__/apps.cpython-310.pyc create mode 100644 api/api/analytics/__pycache__/models.cpython-310.pyc create mode 100644 api/api/analytics/admin.py create mode 100644 api/api/analytics/apps.py create mode 100644 api/api/analytics/migrations/__init__.py create mode 100644 api/api/analytics/models.py create mode 100644 api/api/analytics/tests.py create mode 100644 api/api/analytics/views.py create mode 100644 api/api/api/__pycache__/__init__.cpython-310.pyc create mode 100644 api/api/api/__pycache__/settings.cpython-310.pyc create mode 100644 api/api/blogs/__init__.py create mode 100644 api/api/blogs/admin.py create mode 100644 api/api/blogs/apps.py create mode 100644 api/api/blogs/migrations/__init__.py create mode 100644 api/api/blogs/models.py create mode 100644 api/api/blogs/tests.py create mode 100644 api/api/blogs/urls.py create mode 100644 api/api/blogs/views.py create mode 100644 api/requirements.txt diff --git a/api/api/analytics/__init__.py b/api/api/analytics/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/api/api/analytics/__pycache__/__init__.cpython-310.pyc b/api/api/analytics/__pycache__/__init__.cpython-310.pyc new file mode 100644 index 0000000..8701c3b Binary files /dev/null and b/api/api/analytics/__pycache__/__init__.cpython-310.pyc differ diff --git a/api/api/analytics/__pycache__/admin.cpython-310.pyc b/api/api/analytics/__pycache__/admin.cpython-310.pyc new file mode 100644 index 0000000..860bf6d Binary files /dev/null and b/api/api/analytics/__pycache__/admin.cpython-310.pyc differ diff --git a/api/api/analytics/__pycache__/apps.cpython-310.pyc b/api/api/analytics/__pycache__/apps.cpython-310.pyc new file mode 100644 index 0000000..89945e4 Binary files /dev/null and b/api/api/analytics/__pycache__/apps.cpython-310.pyc differ diff --git a/api/api/analytics/__pycache__/models.cpython-310.pyc b/api/api/analytics/__pycache__/models.cpython-310.pyc new file mode 100644 index 0000000..2af4eb3 Binary files /dev/null and b/api/api/analytics/__pycache__/models.cpython-310.pyc differ diff --git a/api/api/analytics/admin.py b/api/api/analytics/admin.py new file mode 100644 index 0000000..8c38f3f --- /dev/null +++ b/api/api/analytics/admin.py @@ -0,0 +1,3 @@ +from django.contrib import admin + +# Register your models here. diff --git a/api/api/analytics/apps.py b/api/api/analytics/apps.py new file mode 100644 index 0000000..258d4dd --- /dev/null +++ b/api/api/analytics/apps.py @@ -0,0 +1,6 @@ +from django.apps import AppConfig + + +class AnalyticsConfig(AppConfig): + default_auto_field = 'django.db.models.BigAutoField' + name = 'analytics' diff --git a/api/api/analytics/migrations/__init__.py b/api/api/analytics/migrations/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/api/api/analytics/models.py b/api/api/analytics/models.py new file mode 100644 index 0000000..71a8362 --- /dev/null +++ b/api/api/analytics/models.py @@ -0,0 +1,3 @@ +from django.db import models + +# Create your models here. diff --git a/api/api/analytics/tests.py b/api/api/analytics/tests.py new file mode 100644 index 0000000..7ce503c --- /dev/null +++ b/api/api/analytics/tests.py @@ -0,0 +1,3 @@ +from django.test import TestCase + +# Create your tests here. diff --git a/api/api/analytics/views.py b/api/api/analytics/views.py new file mode 100644 index 0000000..91ea44a --- /dev/null +++ b/api/api/analytics/views.py @@ -0,0 +1,3 @@ +from django.shortcuts import render + +# Create your views here. diff --git a/api/api/api/__pycache__/__init__.cpython-310.pyc b/api/api/api/__pycache__/__init__.cpython-310.pyc new file mode 100644 index 0000000..d885b74 Binary files /dev/null and b/api/api/api/__pycache__/__init__.cpython-310.pyc differ diff --git a/api/api/api/__pycache__/settings.cpython-310.pyc b/api/api/api/__pycache__/settings.cpython-310.pyc new file mode 100644 index 0000000..850cf57 Binary files /dev/null and b/api/api/api/__pycache__/settings.cpython-310.pyc differ diff --git a/api/api/api/settings.py b/api/api/api/settings.py index de415b0..1d155a0 100644 --- a/api/api/api/settings.py +++ b/api/api/api/settings.py @@ -31,6 +31,8 @@ ALLOWED_HOSTS = [] # Application definition INSTALLED_APPS = [ + 'rest_framework', + 'analytics.apps.AnalyticsConfig', 'django.contrib.admin', 'django.contrib.auth', 'django.contrib.contenttypes', diff --git a/api/api/api/urls.py b/api/api/api/urls.py index 984d718..f23b858 100644 --- a/api/api/api/urls.py +++ b/api/api/api/urls.py @@ -1,3 +1,4 @@ + """api URL Configuration The `urlpatterns` list routes URLs to views. For more information please see: @@ -14,8 +15,9 @@ Including another URLconf 2. Add a URL to urlpatterns: path('blog/', include('blog.urls')) """ from django.contrib import admin -from django.urls import path +from django.urls import include, path urlpatterns = [ + path('blogs/', include('blogs.urls')), path('admin/', admin.site.urls), ] diff --git a/api/api/blogs/__init__.py b/api/api/blogs/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/api/api/blogs/admin.py b/api/api/blogs/admin.py new file mode 100644 index 0000000..8c38f3f --- /dev/null +++ b/api/api/blogs/admin.py @@ -0,0 +1,3 @@ +from django.contrib import admin + +# Register your models here. diff --git a/api/api/blogs/apps.py b/api/api/blogs/apps.py new file mode 100644 index 0000000..03962d1 --- /dev/null +++ b/api/api/blogs/apps.py @@ -0,0 +1,6 @@ +from django.apps import AppConfig + + +class BlogsConfig(AppConfig): + default_auto_field = 'django.db.models.BigAutoField' + name = 'blogs' diff --git a/api/api/blogs/migrations/__init__.py b/api/api/blogs/migrations/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/api/api/blogs/models.py b/api/api/blogs/models.py new file mode 100644 index 0000000..b096caa --- /dev/null +++ b/api/api/blogs/models.py @@ -0,0 +1,4 @@ +from django.db import models + +# Create your models here. + diff --git a/api/api/blogs/tests.py b/api/api/blogs/tests.py new file mode 100644 index 0000000..7ce503c --- /dev/null +++ b/api/api/blogs/tests.py @@ -0,0 +1,3 @@ +from django.test import TestCase + +# Create your tests here. diff --git a/api/api/blogs/urls.py b/api/api/blogs/urls.py new file mode 100644 index 0000000..306c8bc --- /dev/null +++ b/api/api/blogs/urls.py @@ -0,0 +1,6 @@ +from django.urls import path +from . import views + +urlpatterns = [ + path('', views.index, name='index') +] \ No newline at end of file diff --git a/api/api/blogs/views.py b/api/api/blogs/views.py new file mode 100644 index 0000000..69a6f29 --- /dev/null +++ b/api/api/blogs/views.py @@ -0,0 +1,7 @@ +from django.shortcuts import render +from django.http import HttpResponse + +def index(request): + return HttpResponse("You're at the Blogs index") + +# Create your views here. diff --git a/api/requirements.txt b/api/requirements.txt new file mode 100644 index 0000000..b481e66 --- /dev/null +++ b/api/requirements.txt @@ -0,0 +1,5 @@ +asgiref==3.4.1 +Django==4.0 +djangorestframework==3.13.1 +pytz==2021.3 +sqlparse==0.4.2 -- cgit v1.2.3