├── Boilerplate ├── blog │ ├── main │ │ ├── __init__.py │ │ └── routes.py │ ├── templates │ │ ├── home.html │ │ └── layout.html │ ├── config.py │ └── __init__.py └── run.py ├── .gitignore ├── Project ├── app │ ├── static │ │ ├── js │ │ │ └── app.js │ │ ├── img │ │ │ ├── flask.png │ │ │ └── uploads │ │ │ │ ├── eye.jpg │ │ │ │ ├── a2bpyfptr0j01.jpg │ │ │ │ ├── D-s0F2yW4AA5i47.jpglarge.jpeg │ │ │ │ └── 5dc0b7399c1f89c45154a5963f976db3.jpg │ │ ├── client │ │ │ ├── img │ │ │ │ ├── 01.jpg │ │ │ │ └── 02.jpg │ │ │ ├── reports │ │ │ │ └── 2017 │ │ │ │ │ └── feb │ │ │ │ │ └── comp │ │ │ │ │ └── computer.pdf │ │ │ └── csv │ │ │ │ └── iris.csv │ │ └── css │ │ │ └── style.css │ ├── templates │ │ ├── macros │ │ │ └── input_macros.html │ │ ├── admin │ │ │ ├── profile.html │ │ │ ├── dashboard.html │ │ │ └── templates │ │ │ │ └── admin_template.html │ │ └── public │ │ │ ├── 500.html │ │ │ ├── 404.html │ │ │ ├── about.html │ │ │ ├── index.html │ │ │ ├── profile.html │ │ │ ├── signup.html │ │ │ ├── sign_up.html │ │ │ ├── upload_image.html │ │ │ ├── guestbook.html │ │ │ ├── templates │ │ │ └── public_template.html │ │ │ └── jinja.html │ ├── admin_views.py │ ├── error_handlers.py │ ├── __init__.py │ └── views.py ├── run.py ├── requirements.txt └── config.py ├── Login ├── login.db └── app.py ├── MusicApp ├── mymusic.db ├── test.py ├── app.py ├── templates │ ├── results.html │ ├── _formhelpers.html │ ├── edit_album.html │ ├── new_album.html │ ├── delete_album.html │ └── index.html ├── tables.py ├── db_setup.py ├── forms.py ├── models.py ├── db_creator.py ├── static │ └── style.css └── main.py ├── Scraping ├── dump.rdb ├── run.py └── app │ ├── __init__.py │ ├── views.py │ ├── tasks.py │ └── templates │ └── add_task.html ├── FlaskAdmin ├── exemplo.db └── app.py ├── FlaskExperimentos.png ├── GraphQL ├── database.sqlite3 ├── app.py ├── schema.py ├── database.py └── models.py ├── FileUpload ├── static │ ├── style.css │ └── upload.js ├── app.py └── templates │ └── upload.html ├── Tasks ├── task.py └── main.py ├── HelloWorld ├── hello.py └── about.py ├── Forms ├── Exemplo2 │ ├── templates │ │ ├── obrigado.html │ │ └── index.html │ └── app.py ├── Exemplo1 │ ├── templates │ │ └── index.html │ └── app.py └── Exemplo3 │ ├── app.py │ └── templates │ └── index.html ├── DateTime ├── app.py └── templates │ └── index.html ├── LiveSearch ├── templates │ └── index.html ├── static │ └── search.js └── app.py ├── jQuery ├── process.py ├── static │ └── js │ │ └── form.js └── templates │ └── form.html ├── FlaskChat ├── main.py └── templates │ └── session.html ├── README.md └── requirements.txt /Boilerplate/blog/main/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .myvenv 2 | myvenv/ 3 | __pycache__/ 4 | -------------------------------------------------------------------------------- /Project/app/static/js/app.js: -------------------------------------------------------------------------------- 1 | console.log('Hello from app.js'); -------------------------------------------------------------------------------- /Login/login.db: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/the-akira/FlaskExperimentos/master/Login/login.db -------------------------------------------------------------------------------- /Project/run.py: -------------------------------------------------------------------------------- 1 | from app import app 2 | 3 | if __name__ == '__main__': 4 | app.run(debug=True) -------------------------------------------------------------------------------- /MusicApp/mymusic.db: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/the-akira/FlaskExperimentos/master/MusicApp/mymusic.db -------------------------------------------------------------------------------- /Scraping/dump.rdb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/the-akira/FlaskExperimentos/master/Scraping/dump.rdb -------------------------------------------------------------------------------- /FlaskAdmin/exemplo.db: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/the-akira/FlaskExperimentos/master/FlaskAdmin/exemplo.db -------------------------------------------------------------------------------- /FlaskExperimentos.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/the-akira/FlaskExperimentos/master/FlaskExperimentos.png -------------------------------------------------------------------------------- /GraphQL/database.sqlite3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/the-akira/FlaskExperimentos/master/GraphQL/database.sqlite3 -------------------------------------------------------------------------------- /Project/app/static/img/flask.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/the-akira/FlaskExperimentos/master/Project/app/static/img/flask.png -------------------------------------------------------------------------------- /Boilerplate/run.py: -------------------------------------------------------------------------------- 1 | from blog import create_app 2 | 3 | app = create_app() 4 | 5 | if __name__ == '__main__': 6 | app.run(debug=True) -------------------------------------------------------------------------------- /Project/app/static/client/img/01.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/the-akira/FlaskExperimentos/master/Project/app/static/client/img/01.jpg -------------------------------------------------------------------------------- /Project/app/static/client/img/02.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/the-akira/FlaskExperimentos/master/Project/app/static/client/img/02.jpg -------------------------------------------------------------------------------- /Project/app/static/img/uploads/eye.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/the-akira/FlaskExperimentos/master/Project/app/static/img/uploads/eye.jpg -------------------------------------------------------------------------------- /Project/requirements.txt: -------------------------------------------------------------------------------- 1 | Click==7.0 2 | Flask==1.1.1 3 | itsdangerous==1.1.0 4 | Jinja2==2.11.3 5 | MarkupSafe==1.1.1 6 | Werkzeug==0.15.5 7 | -------------------------------------------------------------------------------- /Boilerplate/blog/templates/home.html: -------------------------------------------------------------------------------- 1 | {% extends "layout.html" %} 2 | 3 | {% block content %} 4 |
Hello World
5 | {% endblock content %} -------------------------------------------------------------------------------- /Project/app/static/img/uploads/a2bpyfptr0j01.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/the-akira/FlaskExperimentos/master/Project/app/static/img/uploads/a2bpyfptr0j01.jpg -------------------------------------------------------------------------------- /FileUpload/static/style.css: -------------------------------------------------------------------------------- 1 | body{ 2 | background-color: #24292e; 3 | } 4 | 5 | h2{ 6 | color: white; 7 | } 8 | 9 | #progress_status{ 10 | color: white; 11 | } -------------------------------------------------------------------------------- /Project/app/static/client/reports/2017/feb/comp/computer.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/the-akira/FlaskExperimentos/master/Project/app/static/client/reports/2017/feb/comp/computer.pdf -------------------------------------------------------------------------------- /Project/app/static/img/uploads/D-s0F2yW4AA5i47.jpglarge.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/the-akira/FlaskExperimentos/master/Project/app/static/img/uploads/D-s0F2yW4AA5i47.jpglarge.jpeg -------------------------------------------------------------------------------- /Boilerplate/blog/config.py: -------------------------------------------------------------------------------- 1 | class Config: 2 | SECRET_KEY = 'ab57ccec0f56942a5ca33215f9d2d88c' 3 | SQLALCHEMY_DATABASE_URI = 'sqlite:///site.db' # caminho relativo em relação ao nosso arquivo -------------------------------------------------------------------------------- /Project/app/static/img/uploads/5dc0b7399c1f89c45154a5963f976db3.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/the-akira/FlaskExperimentos/master/Project/app/static/img/uploads/5dc0b7399c1f89c45154a5963f976db3.jpg -------------------------------------------------------------------------------- /Scraping/run.py: -------------------------------------------------------------------------------- 1 | from app import app 2 | 3 | # Instalar redis-server 4 | # Executar rq worker 5 | # Navegar até http://localhost:5000/add-task 6 | if __name__ == '__main__': 7 | app.run(debug=True) -------------------------------------------------------------------------------- /MusicApp/test.py: -------------------------------------------------------------------------------- 1 | from app import app 2 | from db_setup import init_db 3 | 4 | init_db() 5 | 6 | @app.route('/') 7 | def test(): 8 | return "Welcome to Flask!" 9 | 10 | if __name__ == '__main__': 11 | app.run() -------------------------------------------------------------------------------- /Boilerplate/blog/main/routes.py: -------------------------------------------------------------------------------- 1 | from flask import render_template, request, Blueprint 2 | 3 | main = Blueprint('main', __name__) 4 | 5 | @main.route("/") 6 | @main.route("/home") 7 | def home(): 8 | return render_template('home.html') 9 | -------------------------------------------------------------------------------- /MusicApp/app.py: -------------------------------------------------------------------------------- 1 | from flask import Flask 2 | from flask_sqlalchemy import SQLAlchemy 3 | 4 | app = Flask(__name__) 5 | app.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite:///mymusic.db' 6 | app.secret_key = "flask rocks!" 7 | 8 | db = SQLAlchemy(app) -------------------------------------------------------------------------------- /Scraping/app/__init__.py: -------------------------------------------------------------------------------- 1 | from flask import Flask 2 | import redis 3 | from rq import Queue 4 | 5 | app = Flask(__name__) 6 | 7 | r = redis.Redis() 8 | q = Queue(connection=r) 9 | 10 | from app import views 11 | from app import tasks -------------------------------------------------------------------------------- /MusicApp/templates/results.html: -------------------------------------------------------------------------------- 1 |Você informou o nome {{ name }}
3 |Atualize ele no formulário abaixo:
4 | {% else %} 5 |Por favor, informe o seu nome:
6 | {% endif %} 7 | 8 | 13 | -------------------------------------------------------------------------------- /Project/app/admin_views.py: -------------------------------------------------------------------------------- 1 | from app import app 2 | from flask import render_template 3 | 4 | # Criando uma rota 5 | @app.route('/admin/dashboard') 6 | def admin_dashboard(): 7 | return render_template('admin/dashboard.html') 8 | 9 | # Criando uma nova rota about 10 | @app.route('/admin/profile') 11 | def admin_profile(): 12 | return render_template('admin/profile.html') -------------------------------------------------------------------------------- /Project/app/templates/admin/profile.html: -------------------------------------------------------------------------------- 1 | {% extends 'admin/templates/admin_template.html' %} 2 | 3 | {% block title %}Admin Dashboard{% endblock title %} 4 | 5 | {% block main %} 6 |
12 |
12 | {{ user['name'] }}
17 |{{ user['bio'] }}
18 |{{ user['twitter'] }}
19 | {% else %} 20 |User not found!
21 | {% endif %} 22 |{{ q.title }} - {{ q.artist }}
24 | {% endfor %} 25 | {% from "_formhelpers.html" import render_field %} 26 | 33 |Args: {{ job.args }}
43 | Job ID: {{ job.id }} 44 | Status: {{ job.status }} 45 | Created at: {{ job.created_at.strftime('%a, %d %b %Y %H:%M:%S') }} 46 | Enqueued at: {{ job.enqueued_at.strftime('%a, %d %b %Y %H:%M:%S') }} 47 |No jobs in the queue
52 | {% endif %} 53 |Nome: {{ nome }}
16 | 17 |{{ langs[0] }}
48 | 49 |{{ personagens['Akira'] }}
53 | 54 |{{ remote.name }}
58 | 59 |{% set a, b, c = cores %}
63 |{{ a }}
64 |{{ b }}
65 |{{ c }}
66 | 67 |{{ repeat('Flask is Awesome ', 5) }}
71 | 72 |{{ remote.clone() }}
76 | 77 |Legal é verdadeiro
82 | {% endif %} 83 | 84 |No entry
89 | {% elif idade < 26 %} 90 |Nearly old enough
91 | {% else %} 92 |You may enter the door
93 | {% endif %} 94 | 95 |{{ idade/2 }}
99 | 100 |{{ langs|length }}
104 |{{ nome|reverse }}
105 |{{ nome|upper }}
106 | 107 |{{ langs|join(', ') }}
111 | 112 |{{ date|clean_date }}
116 | 117 |