Core: Send Json over API

This commit is contained in:
Omma 2024-08-05 15:59:09 +03:30
parent a8adb825d5
commit 91f6fca9c8
14 changed files with 243 additions and 0 deletions

0
proxy/__init__.py Normal file
View file

3
proxy/admin.py Normal file
View file

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

6
proxy/apps.py Normal file
View file

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

View file

3
proxy/models.py Normal file
View file

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

3
proxy/tests.py Normal file
View file

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

6
proxy/urls.py Normal file
View file

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

20
proxy/views.py Normal file
View file

@ -0,0 +1,20 @@
from django.shortcuts import render
from django.http import JsonResponse
import json
import requests
# Create your views here.
def send_wells(request):
print("sending wells")
payload = {'data':[
{
"id": 1,
"licence": "12-d-13",
},
{
"id": 2,
"licence": "16-a-111",
},]
}
return JsonResponse(payload)