This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{% load static %} | |
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<title>Previsão do Tempo</title> | |
<link crossorigin="anonymous" | |
href="https://cdnjs.cloudflare.com/ajax/libs/bulma/0.7.4/css/bulma.min.css" | |
integrity="sha256-8B1OaG0zT7uYA572S2xOxWACq9NXYPQ+U5kHPV1bJN4=" | |
rel="stylesheet"/> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from django.conf import settings | |
import requests | |
def get_cd_city(): | |
token = settings.API_TOKEN | |
r = requests.get('https://api.hgbrasil.com/geoip?key={}&address=remote&precision=false'.format(token)) | |
data = r.json() | |
dados_list = data['results']['woeid'] | |
return dados_list |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from django.conf import settings | |
import requests | |
def get_tempo(): | |
token = settings.API_TOKEN | |
r = requests.get('https://api.hgbrasil.com/weather?key={}&user_ip=remote'.format(token)) | |
data = r.json() | |
dados_list = data['results'] | |
return dados_list |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from django.db import models | |
class Categoria(models.Model): | |
nome = models.CharField(max_length=100) | |
class Produtos(models.Model): | |
prod_nome = models.CharField(max_length=250) | |
qtd_estoque= models.IntegerField() | |
preco = models.DecimalField(max_digits=8, decimal_places=2) | |
categoria = models.ForeignKey(Categoria, on_delete=models.CASCADE, default=None) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div class="container"> | |
{% for next_days in next_four_days %} | |
<div class="card"> | |
<div class="card" id="cards_next_days"> | |
{% if '{{ next_days.min }}' == 12 %} | |
<img src="{% static 'icons/parcialmente-nublado.png' %}" style="margin-left: 10px;" width="80" height="80"> | |
{% elif '{{ next_days.min }}' == 13 %} | |
<img src="{% static 'icons/1.jpg' %}" style="margin-left: 10px;" width="80" height="80"> | |
{% endif %} | |
<div class="info"> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from django.contrib import admin | |
from .models import Category, Contact | |
admin.site.register(Category) | |
admin.site.register(Contact) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{% load static %} | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"> | |
<meta name="description" content=""> | |
<meta name="author" content=""> | |
<!-- Bootstrap core CSS --> | |
<link href="{% static 'vendor/bootstrap/css/bootstrap.min.css' %}" rel="stylesheet"> | |
<link href="{% static 'vendor/js/scripts.js' %}"> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{% extends 'base.html' %} | |
{% block content %} | |
<h1 class="mt-5">Minha agenda</h1> | |
<table class="table"> | |
<thead class="thead-dark"> | |
<tr> | |
<th>ID</th> | |
<th>Nome</th> | |
<th>Sobrenome</th> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Day(models.Model): | |
DAY_CHOICES = ( | |
('SEG', 'Segunda'), | |
('TER', 'Terça'), | |
('QUA', 'Quarta'), | |
('QUI', 'Quinta'), | |
('SEX', 'Sexta') | |
) | |
day = models.CharField(max_length=3, choices=DAY_CHOICES, blank=False, | |
null=False, verbose_name="Dia da semana") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{% extends 'base.html' %} | |
{% block content %} | |
<div class="container"> | |
<h1 class="mt-5">Agendamentos</h1> | |
<table class="table"> | |
<thead class="thead-dark"> | |
<tr> | |
<th>ID</th> |
OlderNewer