forked from TDTP/admin_transporte_backend
Merge branch 'master' of https://gitlab.com/m3f_usm/admin_transporte/backend into develop/Ronald
commit
d786071f9e
|
@ -29,4 +29,8 @@ GTFS_UPLOADS=/uploads/gtfs
|
||||||
PHOTOS_UPLOADS=/uploads/photos
|
PHOTOS_UPLOADS=/uploads/photos
|
||||||
|
|
||||||
# URL INFO PARADERO
|
# URL INFO PARADERO
|
||||||
URL_PARADERO='http://localhost:3001/rutaParadero/?id='
|
URL_PARADERO='http://localhost:3001/rutaParadero/?id='
|
||||||
|
|
||||||
|
#COORDENADAS DE INICIO PARA EL MAPA
|
||||||
|
COORDINI_LAT=-36.8270
|
||||||
|
COORDINI_LNG=-73.0503
|
|
@ -18,7 +18,7 @@ class DispositivoViewSet(viewsets.ModelViewSet):
|
||||||
queryset = models.Dispositivo.objects.all()
|
queryset = models.Dispositivo.objects.all()
|
||||||
serializer_class = serializers.DispositivoSerializer
|
serializer_class = serializers.DispositivoSerializer
|
||||||
filter_backends = [DjangoFilterBackend]
|
filter_backends = [DjangoFilterBackend]
|
||||||
filterset_fields = ['id_paradero', 'id_tipo_dispositivo']
|
filterset_fields = ['id_dispositivo', 'id_paradero', 'id_tipo_dispositivo']
|
||||||
|
|
||||||
|
|
||||||
@action(detail=False, methods=['post'])
|
@action(detail=False, methods=['post'])
|
||||||
|
@ -51,7 +51,7 @@ class DispositivoViewSet(viewsets.ModelViewSet):
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
@action(detail=False, methods=['post'])
|
@action(detail=False, methods=['post','get'])
|
||||||
def getInfoDevice(self, request, pk=None):
|
def getInfoDevice(self, request, pk=None):
|
||||||
input = json.loads(request.body)
|
input = json.loads(request.body)
|
||||||
getInfoDevice = input['GetInfoDevice']
|
getInfoDevice = input['GetInfoDevice']
|
||||||
|
@ -214,8 +214,8 @@ class DispositivoViewSet(viewsets.ModelViewSet):
|
||||||
# for pk_linea in lineas_agrupadas:
|
# for pk_linea in lineas_agrupadas:
|
||||||
# detalle_lineas.append(lineas_agrupadas[pk_linea])
|
# detalle_lineas.append(lineas_agrupadas[pk_linea])
|
||||||
|
|
||||||
# save_log_dispositivo(id_dispositivo=getInfoDevice['idDispositivo'], accion_url='getInfoDevice')
|
|
||||||
|
|
||||||
|
save_log_dispositivo(id_dispositivo=getInfoDevice['idDispositivo'], accion_url='getInfoDevice')
|
||||||
cursor.close()
|
cursor.close()
|
||||||
return JsonResponse({
|
return JsonResponse({
|
||||||
"GetInfoDeviceResponse": {
|
"GetInfoDeviceResponse": {
|
||||||
|
|
|
@ -46,6 +46,7 @@ INSTALLED_APPS = [
|
||||||
'corsheaders',
|
'corsheaders',
|
||||||
'django_filters',
|
'django_filters',
|
||||||
'api',
|
'api',
|
||||||
|
'public',
|
||||||
'logger',
|
'logger',
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
|
@ -29,6 +29,7 @@ urlpatterns = [
|
||||||
# BACKEND
|
# BACKEND
|
||||||
path('admin/', admin.site.urls),
|
path('admin/', admin.site.urls),
|
||||||
path('api/', include('api.urls')),
|
path('api/', include('api.urls')),
|
||||||
|
path('api-public/', include('public.urls')),
|
||||||
path('docs/', include_docs_urls(title = 'API Documentation')),
|
path('docs/', include_docs_urls(title = 'API Documentation')),
|
||||||
]#+ static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
|
]#+ static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,3 @@
|
||||||
|
from django.contrib import admin
|
||||||
|
|
||||||
|
# Register your models here.
|
|
@ -0,0 +1,6 @@
|
||||||
|
from django.apps import AppConfig
|
||||||
|
|
||||||
|
|
||||||
|
class PublicConfig(AppConfig):
|
||||||
|
default_auto_field = 'django.db.models.BigAutoField'
|
||||||
|
name = 'public'
|
|
@ -0,0 +1,3 @@
|
||||||
|
from django.db import models
|
||||||
|
|
||||||
|
# Create your models here.
|
|
@ -0,0 +1,3 @@
|
||||||
|
from django.test import TestCase
|
||||||
|
|
||||||
|
# Create your tests here.
|
|
@ -0,0 +1,10 @@
|
||||||
|
from django.urls import path, include
|
||||||
|
from rest_framework import routers
|
||||||
|
from api.views.dispositivo import DispositivoViewSet
|
||||||
|
|
||||||
|
router = routers.DefaultRouter()
|
||||||
|
router.register('paradero_info', DispositivoViewSet)
|
||||||
|
|
||||||
|
urlpatterns = [
|
||||||
|
path('', include(router.urls)),
|
||||||
|
]
|
|
@ -0,0 +1,6 @@
|
||||||
|
from django.shortcuts import render
|
||||||
|
from api.views.dispositivo import DispositivoViewSet
|
||||||
|
|
||||||
|
# Create your views here.
|
||||||
|
class DispositivoPublicViewSet(DispositivoViewSet):
|
||||||
|
pass
|
|
@ -105,10 +105,10 @@ CMD [ "/app/project/manage.py", "runserver", "0.0.0.0:4000" ]
|
||||||
# instrucciones para compilar archivo Dockerfile
|
# instrucciones para compilar archivo Dockerfile
|
||||||
|
|
||||||
~~~bash
|
~~~bash
|
||||||
docker build -t <tagname:version> -f Dockerfile --build-arg gitusername=<usuario gitlab> --build-arg gitpassword=<password gitlab> .
|
docker build -t <tagname:version> -f Dockerfile --no-cache --build-arg gitusername=<usuario gitlab> --build-arg gitpassword=<password gitlab> .
|
||||||
|
|
||||||
# ejemplo
|
# ejemplo
|
||||||
# docker build -t transporte:v1.2 -f Dockerfile --build-arg gitusername=johndoe --build-arg gitpassword=mypassword .
|
# docker build -t transporte:v1.2 -f Dockerfile --no-cache --build-arg gitusername=johndoe --build-arg gitpassword=mypassword .
|
||||||
~~~
|
~~~
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue