большое обновление фронта
This commit is contained in:
@@ -19,5 +19,7 @@ from . import views
|
||||
|
||||
urlpatterns = [
|
||||
path('', views.view_index, name='index'),
|
||||
path('fetch/stats', views.view_stats, name='fetch-stats'),
|
||||
path('fetch/tank-chart', views.view_tank_chart, name='fetch-tank-chart'),
|
||||
# path('methods/<str:method_name>', views.call_method, name='call_method')
|
||||
]
|
||||
|
@@ -1,8 +1,30 @@
|
||||
import os
|
||||
|
||||
from django.http import HttpResponse
|
||||
from django.shortcuts import render
|
||||
from django.db.models import Manager
|
||||
|
||||
# Create your views here.
|
||||
# только для тестирования!
|
||||
import requests
|
||||
|
||||
TEST_BASE_FETCH = "https://test.wawaa.ru/dev-fetch.php"
|
||||
|
||||
|
||||
def view_index(request):
|
||||
return render(request, 'index.html')
|
||||
|
||||
|
||||
def view_stats(request):
|
||||
# только для тестирования!
|
||||
res = requests.get(TEST_BASE_FETCH + "?stats", headers={'Authorization': os.getenv("TEST_AUTH")})
|
||||
response = HttpResponse(res.content)
|
||||
response.headers["Content-type"] = response.headers["Content-type"]
|
||||
return response
|
||||
|
||||
|
||||
def view_tank_chart(request):
|
||||
# только для тестирования!
|
||||
res = requests.get(TEST_BASE_FETCH + "?tank_chart", headers={'Authorization': os.getenv("TEST_AUTH")})
|
||||
response = HttpResponse(res.content)
|
||||
response.headers["Content-type"] = response.headers["Content-type"]
|
||||
return response
|
||||
|
Reference in New Issue
Block a user