Skip to content

Commit

Permalink
u
Browse files Browse the repository at this point in the history
  • Loading branch information
tunonalves committed Jun 29, 2022
1 parent e21a5f0 commit 10fe807
Show file tree
Hide file tree
Showing 28 changed files with 89 additions and 16 deletions.
3 changes: 2 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,6 @@
"name": "sql"
}
],
"sqltools.useNodeRuntime": true
"sqltools.useNodeRuntime": true,
"python.formatting.provider": "black"
}
Binary file modified ProyectoWeb/__pycache__/settings.cpython-310.pyc
Binary file not shown.
Binary file modified ProyectoWeb/__pycache__/urls.cpython-310.pyc
Binary file not shown.
1 change: 1 addition & 0 deletions ProyectoWeb/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
'autenticacion',
'crispy_forms',
'pedidos',
'dolar',
]

MIDDLEWARE = [
Expand Down
3 changes: 2 additions & 1 deletion ProyectoWeb/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -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')),
]
Binary file modified ProyectoWebApp/__pycache__/views.cpython-310.pyc
Binary file not shown.
7 changes: 5 additions & 2 deletions ProyectoWebApp/templates/ProyectoWebApp/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -52,16 +52,19 @@ <h1 class="site-heading text-center text-white d-none d-lg-block">
<li class="nav-item {% if request.path == '/contacto/' %}active{% endif %} px-lg-4">
<a class="btn btn-secondary btn-lg" href="{% url 'Contacto' %}">CONTACT</a>
</li>
<li class="nav-item {% if request.path|slice:':6' == '/blog/' %}active{% endif %} px-lg-4">
<li class="nav-item {% if request.path == '/blog/' %}active{% endif %} px-lg-4">
<a class="btn btn-secondary btn-lg" href="{% url 'Blog' %}">BLOG</a>
</li>
<li class="nav-item {% if request.path == '/dolar/' %}active{% endif %} px-lg-4">
<a class="btn btn-secondary btn-lg" href="{% url 'dolar' %}">U$S</a>
</li>
<li class="nav-item {% if request.path == '/' %}active{% endif %} px-lg-4">
<a class="btn btn-secondary btn-lg" href="https://tunonalves.wixsite.com/federico">ABOUT</a>
</li>
{% if user.is_authenticated %}
</li>
<li class="nav-item {% if request.path == '/' %}active{% endif %} px-lg-4">
<a class="btn btn-secondary btn-lg" href="{% url 'edit' %}">EDIT CONTACT</a>
<a class="btn btn-secondary btn-lg" href="{% url 'edit' %}">EDIT</a>
</li>
{% endif %}
</ul>
Expand Down
1 change: 1 addition & 0 deletions ProyectoWebApp/templates/ProyectoWebApp/home.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{% extends "ProyectoWebApp/base.html" %}
{% load static %}
{% block content %}

<!-- Heading -->
<section class="page-section clearfix">
<div class="container">
Expand Down
2 changes: 1 addition & 1 deletion ProyectoWebApp/views.py
Original file line number Diff line number Diff line change
@@ -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")
Binary file modified db.sqlite3
Binary file not shown.
Empty file added dolar/__init__.py
Empty file.
Binary file added dolar/__pycache__/__init__.cpython-310.pyc
Binary file not shown.
Binary file added dolar/__pycache__/admin.cpython-310.pyc
Binary file not shown.
Binary file added dolar/__pycache__/apps.cpython-310.pyc
Binary file not shown.
Binary file added dolar/__pycache__/models.cpython-310.pyc
Binary file not shown.
Binary file added dolar/__pycache__/urls.cpython-310.pyc
Binary file not shown.
Binary file added dolar/__pycache__/views.cpython-310.pyc
Binary file not shown.
3 changes: 3 additions & 0 deletions dolar/admin.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
from django.contrib import admin

# Register your models here.
6 changes: 6 additions & 0 deletions dolar/apps.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
from django.apps import AppConfig


class DolarConfig(AppConfig):
default_auto_field = 'django.db.models.BigAutoField'
name = 'dolar'
Empty file added dolar/migrations/__init__.py
Empty file.
Binary file not shown.
3 changes: 3 additions & 0 deletions dolar/models.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
from django.db import models

# Create your models here.
28 changes: 28 additions & 0 deletions dolar/templates/dolar/dolar.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{% extends "ProyectoWebApp/base.html" %}
{% load static %}
{% block content %}

<table class="table table-bordered" style="color: white">
<thead>
<tr>
<th colspan="4" class="text-center">U$S</th>
</tr>
<tr>
<th>COTIZACION</th>
<th>FECHA</th>
<th>COMPRA</th>
<th>VENTA</th>
</tr>
</thead>
<tbody>
{% for key,value in cotizacion.items %}
<tr class="text-center">
<th scope="row">{{key | upper}}</th>
<td>{{value.fecha}}</td>
<td>{{value.compra}}</td>
<td>{{value.venta}}</td>
</tr>
{% endfor %}
</tbody>
</table>
{% endblock %}
3 changes: 3 additions & 0 deletions dolar/tests.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
from django.test import TestCase

# Create your tests here.
9 changes: 9 additions & 0 deletions dolar/urls.py
Original file line number Diff line number Diff line change
@@ -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'),

]
23 changes: 23 additions & 0 deletions dolar/views.py
Original file line number Diff line number Diff line change
@@ -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)
Binary file modified tienda/__pycache__/urls.cpython-310.pyc
Binary file not shown.
13 changes: 2 additions & 11 deletions tienda/urls.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,6 @@
from django.urls import path

from .import views


urlpatterns = [


urlpatterns = [
path('',views.tienda, name="Tienda"),


]



]

0 comments on commit 10fe807

Please sign in to comment.