add apps, basic routing, req.txt

This commit is contained in:
Pratyush Desai 2021-12-24 20:44:01 +05:30
parent 5564ffb207
commit 3d69b29067
Signed by: pratyush
GPG Key ID: DBA5BB7505946FAD
24 changed files with 57 additions and 1 deletions

View File

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -0,0 +1,3 @@
from django.contrib import admin
# Register your models here.

View File

@ -0,0 +1,6 @@
from django.apps import AppConfig
class AnalyticsConfig(AppConfig):
default_auto_field = 'django.db.models.BigAutoField'
name = 'analytics'

View File

View File

@ -0,0 +1,3 @@
from django.db import models
# Create your models here.

View File

@ -0,0 +1,3 @@
from django.test import TestCase
# Create your tests here.

View File

@ -0,0 +1,3 @@
from django.shortcuts import render
# Create your views here.

Binary file not shown.

Binary file not shown.

View File

@ -31,6 +31,8 @@ ALLOWED_HOSTS = []
# Application definition
INSTALLED_APPS = [
'rest_framework',
'analytics.apps.AnalyticsConfig',
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',

View File

@ -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),
]

View File

3
api/api/blogs/admin.py Normal file
View File

@ -0,0 +1,3 @@
from django.contrib import admin
# Register your models here.

6
api/api/blogs/apps.py Normal file
View File

@ -0,0 +1,6 @@
from django.apps import AppConfig
class BlogsConfig(AppConfig):
default_auto_field = 'django.db.models.BigAutoField'
name = 'blogs'

View File

4
api/api/blogs/models.py Normal file
View File

@ -0,0 +1,4 @@
from django.db import models
# Create your models here.

3
api/api/blogs/tests.py Normal file
View File

@ -0,0 +1,3 @@
from django.test import TestCase
# Create your tests here.

6
api/api/blogs/urls.py Normal file
View File

@ -0,0 +1,6 @@
from django.urls import path
from . import views
urlpatterns = [
path('', views.index, name='index')
]

7
api/api/blogs/views.py Normal file
View File

@ -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.

5
api/requirements.txt Normal file
View File

@ -0,0 +1,5 @@
asgiref==3.4.1
Django==4.0
djangorestframework==3.13.1
pytz==2021.3
sqlparse==0.4.2