Skip to content

Instantly share code, notes, and snippets.

View pedrohsbarbosa99's full-sized avatar
🎯
Focusing

Pedro barbosa pedrohsbarbosa99

🎯
Focusing
  • Napp Solutions
  • Brazil
View GitHub Profile
{% 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"/>
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
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
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)
<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">
from django.contrib import admin
from .models import Category, Contact
admin.site.register(Category)
admin.site.register(Contact)
@pedrohsbarbosa99
pedrohsbarbosa99 / _head.html
Created November 16, 2020 22:17
Mask input
{% 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' %}">
{% 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>
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")
{% 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>