add kivi server (for requestes)

This commit is contained in:
ismailsosic
2022-06-08 02:13:36 +02:00
parent bfbc70337a
commit 30cc0caae3
25 changed files with 187 additions and 18 deletions

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -1,12 +0,0 @@
from rest_framework.decorators import api_view
from rest_framework.response import Response
import secrets
# Create your views here.
@api_view(['GET'])
def HexaGenerator(request):
if request.method == 'GET':
hexa_id = secrets.token_hex(16)
return Response({"message": "Search id:", "data": hexa_id})

View File

@@ -41,12 +41,9 @@ INSTALLED_APPS = [
'django.contrib.messages',
'django.contrib.staticfiles',
'corsheaders',
'rest_framework',
'Generator',
'cars'
'cars',
]
MIDDLEWARE = [
@@ -57,21 +54,9 @@ MIDDLEWARE = [
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.clickjacking.XFrameOptionsMiddleware',
'corsheaders.middleware.CorsMiddleware',
'django.middleware.common.CommonMiddleware',
]
CORS_ALLOWED_ORIGINS = [
"http://localhost:3000",
"http://127.0.0.1:3000"
]
CORS_ALLOW_METHODS = [
'DELETE',
'GET',
'POST',
'PUT',
]
ROOT_URLCONF = 'kivi_cars.urls'

View File

@@ -20,6 +20,5 @@ from django.urls import path
urlpatterns = [
path('', include("cars.urls")),
path('admin/', admin.site.urls),
# path('generator/', include("Generator.urls")),
]