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
| # Digamos que tenhamos duas exceções personalizadas no arquivo `exceptions`: | |
| class AlgumaException(Exception): | |
| pass | |
| class OutraException(Exception): | |
| pass | |
| # E queremos que essas exceptions não sejam enviadas para o Sentry forma alguma, então podemos ter um outro arquivo |
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
| # Observe que nesse exemplo temos um pacote python com o nome "src" que é onde fica todo o código da nossa aplicação | |
| # Primeiro devemos ter o arquivo "wsgi.py" que vai ser o cara que vamos usar para subir o servidor gunicorn, | |
| # ele deve ser simples e apenas chamar nossa função de criação da aplicação: | |
| from src import create_app | |
| app = create_app() | |
| # Digamos que temos um arquivo com o nome "logging_config.py" dentro do pacote "logging_config" que fica dentro também do |
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
| Produto.class: | |
| ``` | |
| @Entity | |
| public class Produto { | |
| @Id @GeneratedValue(strategy = GenerationType.IDENTITY) | |
| private int id; | |
| private String titulo; |
NewerOlder