├── .gitignore ├── static ├── imagens │ ├── flower.gif │ ├── lisp.png │ ├── fractal.jpg │ ├── hal9000.jpg │ └── mandelbrotset.jpg └── style.css ├── requirements.txt ├── app.py ├── README.md ├── LICENSE ├── templates └── home.html └── posts.py /.gitignore: -------------------------------------------------------------------------------- 1 | .myvenv 2 | myvenv/ 3 | __pycache__/ 4 | -------------------------------------------------------------------------------- /static/imagens/flower.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/the-akira/Flask-Blog/master/static/imagens/flower.gif -------------------------------------------------------------------------------- /static/imagens/lisp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/the-akira/Flask-Blog/master/static/imagens/lisp.png -------------------------------------------------------------------------------- /static/imagens/fractal.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/the-akira/Flask-Blog/master/static/imagens/fractal.jpg -------------------------------------------------------------------------------- /static/imagens/hal9000.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/the-akira/Flask-Blog/master/static/imagens/hal9000.jpg -------------------------------------------------------------------------------- /static/imagens/mandelbrotset.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/the-akira/Flask-Blog/master/static/imagens/mandelbrotset.jpg -------------------------------------------------------------------------------- /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.16.0 7 | -------------------------------------------------------------------------------- /app.py: -------------------------------------------------------------------------------- 1 | from flask import Flask, render_template 2 | from posts import posts 3 | 4 | app = Flask(__name__) 5 | 6 | @app.route('/') 7 | def home(): 8 | return render_template('home.html', posts=posts) 9 | 10 | if __name__ == '__main__': 11 | app.run(debug=True) -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Flask Blog 2 | 3 | Menor e mais simples Blog do Mundo. 4 | 5 | Pequena aplicação feita como exemplo para ensinar como fazer Deploy de uma aplicação Flask. 6 | 7 | Leia o **[Tutorial](https://akiradev.netlify.app/posts/flask-heroku/)** 8 | 9 | --- 10 | 11 | ## Como utilizar a aplicação 12 | 13 | ### Crie um clone do repositório 14 | 15 | ``` 16 | git clone https://github.com/the-akira/Flask-Blog.git 17 | ``` 18 | 19 | ### Dentro do diretório principal 20 | 21 | Crie um Ambiente Virtual 22 | 23 | ``` 24 | python -m venv myvenv 25 | ``` 26 | 27 | Ative o Ambiente Virtual 28 | 29 | ``` 30 | source myvenv/bin/activate 31 | ``` 32 | 33 | Instale as dependências necessárias 34 | 35 | ``` 36 | pip install -r requirements.txt 37 | ``` 38 | 39 | Execute o arquivo `app.py` 40 | 41 | ``` 42 | python app.py 43 | ``` 44 | 45 | Navegue até a página `http://127.0.0.1:5000/` para ver a aplicação. 46 | 47 | Utilize o arquivo `posts.py` para definir os **posts** do blog 48 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2019 Gabriel Felippe 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /templates/home.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 |
5 | 6 | 7 |Escrito por {{ post.autor }}
26 |{{ post.conteudo }}
27 | Ler mais 28 |{{ post.data }}
30 |