- Apostila de Python (para eventual uso) -> apresenta aspectos que vão desde a instalação até a orientação a objetos.
- Tutorial passo a passo de primeiros passos com o Flask.
- Vídeo aula de primeiros passos com o Flask.
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
<project xmlns="http://maven.apache.org/POM/4.0.0" | |
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | |
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd"> | |
<modelVersion>4.0.0</modelVersion> | |
<groupId>JPALab</groupId> | |
<artifactId>JPALab</artifactId> | |
<version>0.0.1-SNAPSHOT</version> | |
<packaging>war</packaging> | |
<build> | |
<plugins> |
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
self.app = app | |
self.app.config['MYSQL_DATABASE_USER'] = 'jrh723dnnjs1u5ce' | |
self.app.config['MYSQL_DATABASE_PASSWORD'] = 'w8hzubq4xseu9djj' | |
self.app.config['MYSQL_DATABASE_DB'] = 'gcj94fo1u2n7n1ze' | |
self.app.config['MYSQL_DATABASE_HOST'] = 'z5zm8hebixwywy9d.cbetxkdyhwsb.us-east-1.rds.amazonaws.com' | |
self.mysql = MySQL(cursorclass=pymysql.cursors.DictCursor) | |
self.mysql.init_app(self.app) |
Esta é uma breve introdução ao framework Flask e pode servir como um tutorial prático para dar os primeiros passos com o Flask.
Irei mostrar como instalar o Flask de modo bem simples e também mostrar o “Hello World!” com Flask, além de uma breve noção do que vem a ser esse tal de Fask…
Flask é um micro-framework para Python, segundo a documentação…
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
programa | |
{ | |
funcao inicio() | |
{ | |
inteiro tamanho_tabua = 5 | |
inteiro tamanho_tabua_cm = tamanho_tabua * 100 | |
inteiro tamanho_pedaco_cm = 45 | |
inteiro numero_pedacos = 0 |
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
String getBaseUrl(HttpServletRequest request) { | |
String baseUrl = request.getRequestURL().substring(0, request.getRequestURL().length() - request.getRequestURI().length()) + request.getContextPath(); | |
return baseUrl; | |
} |
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
package app; | |
import java.io.IOException; | |
import javax.servlet.ServletException; | |
import javax.servlet.annotation.WebServlet; | |
import javax.servlet.http.HttpServlet; | |
import javax.servlet.http.HttpServletRequest; | |
import javax.servlet.http.HttpServletResponse; |
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
package database; | |
import java.sql.Connection; | |
import java.sql.DriverManager; | |
import java.sql.SQLException; | |
public class ConnectionFactory { | |
private static Connection connection; | |