This file contains hidden or 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
# Rename this file to .env and replace the value below with your actual API key | |
OPENAI_API_KEY="your-api-key-here" |
This file contains hidden or 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 i18n %} | |
<div class="card-tools"> | |
<form class="form-inline" action="." method="GET"> | |
<div class="input-group input-group-sm" style="margin-left: 20px;"> | |
<label for="id_paginate" style="margin-right: 5px;">{% trans "Show" %}</label> | |
<select class="form-control" name="paginate_by" id="id_paginate" onchange="this.form.submit()"> | |
{% for pages in range_pagination %} | |
{% if paginate_by == pages %} | |
<option selected="selected">{{ pages }}</option> |
This file contains hidden or 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
import operator | |
from functools import reduce | |
from django.contrib.auth.mixins import LoginRequiredMixin | |
from django.db import models | |
from django.views.generic import ListView | |
from django.views.generic.base import ContextMixin | |
from django_stuff.utils import remove_special_characters | |
from quotation_project.utils import clean_url |
This file contains hidden or 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 i18n %} | |
{% load l10n %} | |
{% load static %} | |
{% load app_utils %} | |
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="utf-8"> |
This file contains hidden or 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 User(models.Model): | |
email = models.EmailField() | |
endereco = models.ForeignKey(Endereco) | |
class State(models.Model): | |
name = models.CharField() | |
class City(models.Model): | |
name = models.CharField() |
This file contains hidden or 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
#!/usr/bin/env python | |
# encoding: utf-8 | |
import re | |
import sys | |
import requests | |
API_CEP = 'http://api.postmon.com.br/v1/cep/{}' | |
This file contains hidden or 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 import forms | |
from django.contrib.auth import get_user_model, password_validation | |
User = get_user_model() | |
class RegisterForm(forms.ModelForm): | |
password2 = forms.CharField( | |
label="Confirmacao", |
This file contains hidden or 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
#!/bin/bash | |
set -e | |
apps=( "olist-orders-api" "olist-freights-api" "olist-correios-api" ) | |
order_exclude_tables=( "olist_orders_orderhistory" "olist_orders_orderhistory" "seller_orders_sellerorderhistory" "seller_orders_sellerorderitemhistory" ) | |
correios_exclude_tables=( ) | |
freights_exclude_tables=( ) | |
get_exclude_params() { |
This file contains hidden or 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 import forms | |
from django.contrib.auth.forms import UserCreationForm | |
class FormSignUp(UserCreationForm): | |
email = forms.CharField(max_length=254, required=True, widget=forms.EmailInput()) | |
class Meta: | |
model = User | |
fields = [ |
This file contains hidden or 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
import sys | |
sys.path.append('CAMINHO_DO_PROJETO') | |
from NOME_DO_PROJETO import settings | |
from django.core.management import setup_environ | |
setup_environ(settings) |
NewerOlder