diff --git a/.vscode/settings.json b/.vscode/settings.json index 90758e2..071540b 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -7,5 +7,6 @@ "name": "sql" } ], - "sqltools.useNodeRuntime": true + "sqltools.useNodeRuntime": true, + "python.formatting.provider": "black" } \ No newline at end of file diff --git a/ProyectoWeb/__pycache__/settings.cpython-310.pyc b/ProyectoWeb/__pycache__/settings.cpython-310.pyc index dd6bbd5..389cf19 100644 Binary files a/ProyectoWeb/__pycache__/settings.cpython-310.pyc and b/ProyectoWeb/__pycache__/settings.cpython-310.pyc differ diff --git a/ProyectoWeb/__pycache__/urls.cpython-310.pyc b/ProyectoWeb/__pycache__/urls.cpython-310.pyc index de735b0..3967a42 100644 Binary files a/ProyectoWeb/__pycache__/urls.cpython-310.pyc and b/ProyectoWeb/__pycache__/urls.cpython-310.pyc differ diff --git a/ProyectoWeb/settings.py b/ProyectoWeb/settings.py index 98cd529..83fbd00 100644 --- a/ProyectoWeb/settings.py +++ b/ProyectoWeb/settings.py @@ -48,6 +48,7 @@ 'autenticacion', 'crispy_forms', 'pedidos', + 'dolar', ] MIDDLEWARE = [ diff --git a/ProyectoWeb/urls.py b/ProyectoWeb/urls.py index e1484ae..e165333 100644 --- a/ProyectoWeb/urls.py +++ b/ProyectoWeb/urls.py @@ -27,6 +27,7 @@ path('autenticacion/', include('autenticacion.urls')), path('tienda/', include('tienda.urls')), path('carro/', include('carro.urls')), - path('pedidos/', include('pedidos.urls')), + path('pedidos/', include('pedidos.urls')), + path('dolar/', include('dolar.urls')), path('', include('ProyectoWebApp.urls')), ] diff --git a/ProyectoWebApp/__pycache__/views.cpython-310.pyc b/ProyectoWebApp/__pycache__/views.cpython-310.pyc index 7a76abe..08bf2a5 100644 Binary files a/ProyectoWebApp/__pycache__/views.cpython-310.pyc and b/ProyectoWebApp/__pycache__/views.cpython-310.pyc differ diff --git a/ProyectoWebApp/templates/ProyectoWebApp/base.html b/ProyectoWebApp/templates/ProyectoWebApp/base.html index a099ac3..a3223bf 100644 --- a/ProyectoWebApp/templates/ProyectoWebApp/base.html +++ b/ProyectoWebApp/templates/ProyectoWebApp/base.html @@ -52,16 +52,19 @@

- + {% if user.is_authenticated %} {% endif %} diff --git a/ProyectoWebApp/templates/ProyectoWebApp/home.html b/ProyectoWebApp/templates/ProyectoWebApp/home.html index 7d44805..62c6457 100644 --- a/ProyectoWebApp/templates/ProyectoWebApp/home.html +++ b/ProyectoWebApp/templates/ProyectoWebApp/home.html @@ -1,6 +1,7 @@ {% extends "ProyectoWebApp/base.html" %} {% load static %} {% block content %} +
diff --git a/ProyectoWebApp/views.py b/ProyectoWebApp/views.py index 6418ad0..455bcc2 100644 --- a/ProyectoWebApp/views.py +++ b/ProyectoWebApp/views.py @@ -1,6 +1,6 @@ from django.shortcuts import render, HttpResponse from carro.carro import Carro - + def home(request): carro = Carro(request) return render(request, "ProyectoWebApp/home.html") \ No newline at end of file diff --git a/db.sqlite3 b/db.sqlite3 index 9262b10..2c1af34 100644 Binary files a/db.sqlite3 and b/db.sqlite3 differ diff --git a/dolar/__init__.py b/dolar/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/dolar/__pycache__/__init__.cpython-310.pyc b/dolar/__pycache__/__init__.cpython-310.pyc new file mode 100644 index 0000000..c715e2e Binary files /dev/null and b/dolar/__pycache__/__init__.cpython-310.pyc differ diff --git a/dolar/__pycache__/admin.cpython-310.pyc b/dolar/__pycache__/admin.cpython-310.pyc new file mode 100644 index 0000000..38694e0 Binary files /dev/null and b/dolar/__pycache__/admin.cpython-310.pyc differ diff --git a/dolar/__pycache__/apps.cpython-310.pyc b/dolar/__pycache__/apps.cpython-310.pyc new file mode 100644 index 0000000..f448d6f Binary files /dev/null and b/dolar/__pycache__/apps.cpython-310.pyc differ diff --git a/dolar/__pycache__/models.cpython-310.pyc b/dolar/__pycache__/models.cpython-310.pyc new file mode 100644 index 0000000..443e37a Binary files /dev/null and b/dolar/__pycache__/models.cpython-310.pyc differ diff --git a/dolar/__pycache__/urls.cpython-310.pyc b/dolar/__pycache__/urls.cpython-310.pyc new file mode 100644 index 0000000..03fe116 Binary files /dev/null and b/dolar/__pycache__/urls.cpython-310.pyc differ diff --git a/dolar/__pycache__/views.cpython-310.pyc b/dolar/__pycache__/views.cpython-310.pyc new file mode 100644 index 0000000..d51cdcf Binary files /dev/null and b/dolar/__pycache__/views.cpython-310.pyc differ diff --git a/dolar/admin.py b/dolar/admin.py new file mode 100644 index 0000000..8c38f3f --- /dev/null +++ b/dolar/admin.py @@ -0,0 +1,3 @@ +from django.contrib import admin + +# Register your models here. diff --git a/dolar/apps.py b/dolar/apps.py new file mode 100644 index 0000000..d8a7f17 --- /dev/null +++ b/dolar/apps.py @@ -0,0 +1,6 @@ +from django.apps import AppConfig + + +class DolarConfig(AppConfig): + default_auto_field = 'django.db.models.BigAutoField' + name = 'dolar' diff --git a/dolar/migrations/__init__.py b/dolar/migrations/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/dolar/migrations/__pycache__/__init__.cpython-310.pyc b/dolar/migrations/__pycache__/__init__.cpython-310.pyc new file mode 100644 index 0000000..832fb40 Binary files /dev/null and b/dolar/migrations/__pycache__/__init__.cpython-310.pyc differ diff --git a/dolar/models.py b/dolar/models.py new file mode 100644 index 0000000..71a8362 --- /dev/null +++ b/dolar/models.py @@ -0,0 +1,3 @@ +from django.db import models + +# Create your models here. diff --git a/dolar/templates/dolar/dolar.html b/dolar/templates/dolar/dolar.html new file mode 100644 index 0000000..e8995dc --- /dev/null +++ b/dolar/templates/dolar/dolar.html @@ -0,0 +1,28 @@ +{% extends "ProyectoWebApp/base.html" %} +{% load static %} +{% block content %} + + + + + + + + + + + + + + + {% for key,value in cotizacion.items %} + + + + + + + {% endfor %} + +
U$S
COTIZACIONFECHACOMPRAVENTA
{{key | upper}}{{value.fecha}}{{value.compra}}{{value.venta}}
+{% endblock %} \ No newline at end of file diff --git a/dolar/tests.py b/dolar/tests.py new file mode 100644 index 0000000..7ce503c --- /dev/null +++ b/dolar/tests.py @@ -0,0 +1,3 @@ +from django.test import TestCase + +# Create your tests here. diff --git a/dolar/urls.py b/dolar/urls.py new file mode 100644 index 0000000..619b41e --- /dev/null +++ b/dolar/urls.py @@ -0,0 +1,9 @@ +from django import urls +from django.contrib import admin +from django.urls import path, include +from . import views + +urlpatterns = [ + path('', views.cotizacion, name= 'dolar'), + +] \ No newline at end of file diff --git a/dolar/views.py b/dolar/views.py new file mode 100644 index 0000000..232841f --- /dev/null +++ b/dolar/views.py @@ -0,0 +1,23 @@ +from django.shortcuts import render +import requests + +def cotizacion(request): + oficial = requests.get('https://api-dolar-argentina.herokuapp.com/api/dolaroficial') + blue = requests.get('https://api-dolar-argentina.herokuapp.com/api/dolarblue') + liqui = requests.get('https://api-dolar-argentina.herokuapp.com/api/contadoliqui') + turista = requests.get('https://api-dolar-argentina.herokuapp.com/api/dolarturista') + bolsa = requests.get('https://api-dolar-argentina.herokuapp.com/api/dolarbolsa') + r1 = oficial.json() + r2 = blue.json() + r3 = liqui.json() + r4 = turista.json() + r5 = bolsa.json() + resultados = { + "oficial":r1, + "blue":r2, + "liqui":r3, + "turista":r4, + "bolsa":r5 + } + context = {'cotizacion':resultados} + return render(request, "dolar/dolar.html",context) \ No newline at end of file diff --git a/tienda/__pycache__/urls.cpython-310.pyc b/tienda/__pycache__/urls.cpython-310.pyc index 6941c45..204bd22 100644 Binary files a/tienda/__pycache__/urls.cpython-310.pyc and b/tienda/__pycache__/urls.cpython-310.pyc differ diff --git a/tienda/urls.py b/tienda/urls.py index c3774a3..3c3c890 100644 --- a/tienda/urls.py +++ b/tienda/urls.py @@ -1,15 +1,6 @@ from django.urls import path - from .import views - -urlpatterns = [ - - +urlpatterns = [ path('',views.tienda, name="Tienda"), - - -] - - - +] \ No newline at end of file