From 10fe8079fcf43366b554081543c814b6a729695d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Federico=20Tu=C3=B1on=20Alves?= Date: Wed, 29 Jun 2022 00:29:35 -0300 Subject: [PATCH] u --- .vscode/settings.json | 3 +- .../__pycache__/settings.cpython-310.pyc | Bin 3035 -> 3078 bytes ProyectoWeb/__pycache__/urls.cpython-310.pyc | Bin 1303 -> 1373 bytes ProyectoWeb/settings.py | 1 + ProyectoWeb/urls.py | 3 +- .../__pycache__/views.cpython-310.pyc | Bin 438 -> 474 bytes .../templates/ProyectoWebApp/base.html | 7 +++-- .../templates/ProyectoWebApp/home.html | 1 + ProyectoWebApp/views.py | 2 +- db.sqlite3 | Bin 217088 -> 217088 bytes dolar/__init__.py | 0 dolar/__pycache__/__init__.cpython-310.pyc | Bin 0 -> 196 bytes dolar/__pycache__/admin.cpython-310.pyc | Bin 0 -> 237 bytes dolar/__pycache__/apps.cpython-310.pyc | Bin 0 -> 473 bytes dolar/__pycache__/models.cpython-310.pyc | Bin 0 -> 234 bytes dolar/__pycache__/urls.cpython-310.pyc | Bin 0 -> 431 bytes dolar/__pycache__/views.cpython-310.pyc | Bin 0 -> 969 bytes dolar/admin.py | 3 ++ dolar/apps.py | 6 ++++ dolar/migrations/__init__.py | 0 .../__pycache__/__init__.cpython-310.pyc | Bin 0 -> 207 bytes dolar/models.py | 3 ++ dolar/templates/dolar/dolar.html | 28 ++++++++++++++++++ dolar/tests.py | 3 ++ dolar/urls.py | 9 ++++++ dolar/views.py | 23 ++++++++++++++ tienda/__pycache__/urls.cpython-310.pyc | Bin 316 -> 332 bytes tienda/urls.py | 13 ++------ 28 files changed, 89 insertions(+), 16 deletions(-) create mode 100644 dolar/__init__.py create mode 100644 dolar/__pycache__/__init__.cpython-310.pyc create mode 100644 dolar/__pycache__/admin.cpython-310.pyc create mode 100644 dolar/__pycache__/apps.cpython-310.pyc create mode 100644 dolar/__pycache__/models.cpython-310.pyc create mode 100644 dolar/__pycache__/urls.cpython-310.pyc create mode 100644 dolar/__pycache__/views.cpython-310.pyc create mode 100644 dolar/admin.py create mode 100644 dolar/apps.py create mode 100644 dolar/migrations/__init__.py create mode 100644 dolar/migrations/__pycache__/__init__.cpython-310.pyc create mode 100644 dolar/models.py create mode 100644 dolar/templates/dolar/dolar.html create mode 100644 dolar/tests.py create mode 100644 dolar/urls.py create mode 100644 dolar/views.py 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 dd6bbd5fe6005eb4d7787d79c306cd54e59f49af..389cf19682e38044dffbdfac345f9bc49d64b966 100644 GIT binary patch delta 114 zcmcaD-X_7D&&$ij00h^L?oJZf$h((`QDE|Erf=*~tSR|9iA9?aGW)XI$?Vrgt~b82kQq^mSp7T>AGYk=B4NByL!0>IeR(- QB_?ZdhcF6HuH}vc0FUG)^#A|> delta 70 zcmZpZxGm0`&&$ij00bQq=OwXk`pqw!octt#6bqUK#l_t7q6M9JzFf5Ek!JqJw?2kv6(5I zD~dBkBA7u_a^rD5;BK;~ZFg;n3rO_@^KeRZts93+GG%r6dF{doGSl=Z- zximL5ucTPtH8>>H#nV4nKcKQCBR@~qB`Yy6Jzw9|%QeW^(-|l+c@K*HBzqnp~b01#rh?sdHH#XIc2HE`Yx%(*(Lb}lUS`8WhUFO$}(|$2LK2G8w&sc 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 7a76abeabc25fc010e02fb9becac5481a2e78763..08bf2a508def32be2f460d80ccf3667b5879cd2a 100644 GIT binary patch delta 88 zcmdnSe2bYkpO=@50SNLB?@rn>k@tyRu6}57YEiL%NoihwUSdvJYO%gcesXDUYF - + {% 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 9262b104bef7eee8869486c010fdd4dd39ba3ac7..2c1af340abfdcded2b0af3233f6703e347ece5b4 100644 GIT binary patch delta 1054 zcmah{OK2Nc6rDHv#GcVeCJt?B(?(6|5DXGC^G2FCQz(@!S+@R)Wye+v&cq&#{(o7Y z7Hn5_x@%LK=JGI)1Y|o`nMa#ix`Fx39%tYdgnE5B_bJGktqK*{s%{Hy!XP$GUGy^rsx*6#ay{UOe)E8VSr0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QL%nW zXH6Een4eOMt+{IOIBiDdcMA^murx-r!!ch zC_gJTxx_6Ks8=@xWQHTyjFkMG#3KFp_{_Y_lK6PNg34PQHo5sJr8%i~AO{pP0SOic E0A*`3od5s; literal 0 HcmV?d00001 diff --git a/dolar/__pycache__/admin.cpython-310.pyc b/dolar/__pycache__/admin.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..38694e0dbecaa6d91999336b7c4ac22ed17ddc6f GIT binary patch literal 237 zcmd1j<>g`k0=vVzlk9=?V-N=!FabFZKwK;UBvKes7;_kM8KW2(8B&;n88n$+0!0}# z8E>&BrsQVk`Drpm@ug%X=B4NBCFkdr6lEqAfecv5P{a(Rz{IZ<{m|mnqGJ7$(!Bh< z#GJC!VttqVIH#59Nq4@V?>^t1>U5e2r2qA~dWZMh1gBy{FaXt8U^wDfq6CK+qg%u+PTmkF z0>6^b;`SW5jUPZE7gy)QEE}nG9d9C&ITZ}S091Fu2oz$Dpc{vTTcOPfu-H{AP?F^b zg8e1mvUH<7zVZ^qh1A|nycw2-n#4l#s=*C*<~Aya(v&5F(yB=*Kuc--Hl@!clgG*h z7i(6^f-)eW>zctfwGWh=OVs8!@|RlV+AqpfrA)pE?FT9<6Ok6$AI}%dV0u6IA9lr) zN_#;)oA%Jy}gCu7}gy1q&~|s?Pa^1z<1`n`V5SNZ0z7VH*-nV gI__++xn<@u=>G{1UJG)SbA4E~Zw{*sVHg`k0=vVzlPrPsV-N=!FabFZKwK;UBvKes7;_kM8KW2(8B&;n88n$+0!0}# z8E>)W=BK3Q6#Hp1-QrBiO3X{o*Gow%0%=~!P{abHz{Iaq{m|mnqGJ7$(!Bh<#GJC! zVttqVLo{{~23Y;xIKQ`~qe|hrXkR!M5>A3>}2xNdm455!ZtiuBwv~j>f zjxgd8jvNmOVlhu}0s%!NqRGBXVv@WDTZmKAU4lG4yLljoHf$8r&ZCm>TI3xY9!j&b zaV;v=5PF6e89LVVSzCY+k*rj{QIwoM8S^-EdRQrMnTxfKjmLcaku@FEZ2Rk7Ao>B2NZijp0vE+(>SI2A@0 z)8%SCnLRFxr<2)9F`TqJ71Q~2F`kXvf|7e$nfu!H4p)B0T|1+_r|_$d4kw#jb4eOT TZ~WalbC7`yUcn3wg5>8HMUQjo literal 0 HcmV?d00001 diff --git a/dolar/__pycache__/views.cpython-310.pyc b/dolar/__pycache__/views.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..d51cdcf2aa38435d88c08a421584eea85a43e132 GIT binary patch literal 969 zcmbVL&2rN)5SC;+cH9K|2pqWNka+kTm`;a*Ny1Dy1ctPi+!RYB4vv*da-kW83k*-e zp*`{poOuadIq?c`VWp%qy|&VPyPvJq{&_9h?G(ZK_Uq?#6d?55JzQS|9$o;{JrE2r zT%skOVC*<4$%L?gg;1S?4;K?MFT-BxPkFv4r6#t}uAbAJu|FY~vaj7z0SE8cj8CTgr zI{@La!wQ7F5|&c{pdV_Vl* z!9S|r>Rcue%4MtWgGlk!PVm(xgy8LN{7d2%_BWsz`^<;zskx9kueI`>kWFyoO?(m8 Z#9cVB$>CD4y5!H@kEL91S}4IS@*lpu7cc+- literal 0 HcmV?d00001 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 0000000000000000000000000000000000000000..832fb40255ab931f9faee79de34076fe8a8e8912 GIT binary patch literal 207 zcmd1j<>g`k0=vVzlR)%i5P=LBfgA@QE@lA|DGb33nv8xc8Hzx{2;x_ferR!OQL%nW zXH6Een4eOMt+{IOIBiDdcMA^murx-r!!ch zC_gJTxx_6Ks8=@xWQHTyjFkMG#3KFN%=DtflFa + + + U$S + + + COTIZACION + FECHA + COMPRA + VENTA + + + + {% for key,value in cotizacion.items %} + + {{key | upper}} + {{value.fecha}} + {{value.compra}} + {{value.venta}} + + {% endfor %} + + +{% 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 6941c457364997346d4dfcc921e97e4869c93507..204bd22e89e2560a92d351348a523a7c7df8f96a 100644 GIT binary patch delta 85 zcmdnPbcTsHpO=@50SG1@*_~88k#|31%EYs(1_6~N8Tom-E?J3r>G}GuUampTp3a{B o!TJG3`B|ySC2pB{i8;CzjyYwi#gl~?RaqJNm^uCf0IS3stpET3 delta 69 zcmX@Zw1