diff options
author | Pratyush Desai | 2021-12-24 20:44:01 +0530 |
---|---|---|
committer | Pratyush Desai | 2021-12-24 20:44:01 +0530 |
commit | 3d69b2906702025ef40bd6037279a91f971255d4 (patch) | |
tree | f6cc465c3a21637fbec1b5b1fdb5808437774d1d /api | |
parent | 5564ffb20798d45bf87910feea39bf02b0d2dee4 (diff) | |
download | website-3d69b2906702025ef40bd6037279a91f971255d4.tar.gz website-3d69b2906702025ef40bd6037279a91f971255d4.tar.bz2 website-3d69b2906702025ef40bd6037279a91f971255d4.zip |
add apps, basic routing, req.txt
Diffstat (limited to 'api')
24 files changed, 57 insertions, 1 deletions
diff --git a/api/api/analytics/__init__.py b/api/api/analytics/__init__.py new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/api/api/analytics/__init__.py diff --git a/api/api/analytics/__pycache__/__init__.cpython-310.pyc b/api/api/analytics/__pycache__/__init__.cpython-310.pyc Binary files differnew file mode 100644 index 0000000..8701c3b --- /dev/null +++ b/api/api/analytics/__pycache__/__init__.cpython-310.pyc diff --git a/api/api/analytics/__pycache__/admin.cpython-310.pyc b/api/api/analytics/__pycache__/admin.cpython-310.pyc Binary files differnew file mode 100644 index 0000000..860bf6d --- /dev/null +++ b/api/api/analytics/__pycache__/admin.cpython-310.pyc diff --git a/api/api/analytics/__pycache__/apps.cpython-310.pyc b/api/api/analytics/__pycache__/apps.cpython-310.pyc Binary files differnew file mode 100644 index 0000000..89945e4 --- /dev/null +++ b/api/api/analytics/__pycache__/apps.cpython-310.pyc diff --git a/api/api/analytics/__pycache__/models.cpython-310.pyc b/api/api/analytics/__pycache__/models.cpython-310.pyc Binary files differnew file mode 100644 index 0000000..2af4eb3 --- /dev/null +++ b/api/api/analytics/__pycache__/models.cpython-310.pyc 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 --- /dev/null +++ b/api/api/analytics/migrations/__init__.py 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 Binary files differnew file mode 100644 index 0000000..d885b74 --- /dev/null +++ b/api/api/api/__pycache__/__init__.cpython-310.pyc diff --git a/api/api/api/__pycache__/settings.cpython-310.pyc b/api/api/api/__pycache__/settings.cpython-310.pyc Binary files differnew file mode 100644 index 0000000..850cf57 --- /dev/null +++ b/api/api/api/__pycache__/settings.cpython-310.pyc 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 --- /dev/null +++ b/api/api/blogs/__init__.py 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 --- /dev/null +++ b/api/api/blogs/migrations/__init__.py 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 |