Add images
This commit is contained in:
parent
1dc9dc6d58
commit
dd11a2b05a
32
README.md
32
README.md
@ -1027,3 +1027,35 @@ if __name__ == '__main__':
|
|||||||
|
|
||||||
---
|
---
|
||||||
### Part 3 - Sending emails with new items (Envío de emails con nuevos elementos)
|
### Part 3 - Sending emails with new items (Envío de emails con nuevos elementos)
|
||||||
|
|
||||||
|
#### 3.1 Command
|
||||||
|
|
||||||
|
[ES] Ya tenemos montado nuestra interfaz para gestionar nuestras busquedas. Lo siguiente será crear un *script* que se encargue de verificar si hay nuevos resultados. Y si es así, enviarnos un *email*. El primer paso será crear con Flask un comando personalizado. Creamos un nuevo archivo llamado **avisador.py**.
|
||||||
|
|
||||||
|
```python3
|
||||||
|
#!/usr/bin/env python3
|
||||||
|
from flask_script import Manager
|
||||||
|
from app import app
|
||||||
|
|
||||||
|
manager = Manager(app)
|
||||||
|
|
||||||
|
@manager.command
|
||||||
|
def hello():
|
||||||
|
print('hello PyConES17')
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
manager.run()
|
||||||
|
```
|
||||||
|
|
||||||
|
[ES] Para probar que funciona ejecutamos, siempre con el entorno virtual activo, lo siguiente.
|
||||||
|
|
||||||
|
```bash
|
||||||
|
chmod +x avisador.py
|
||||||
|
./avisador.py hello
|
||||||
|
```
|
||||||
|
|
||||||
|
[ES] Si todo ha ido bien nos responderá.
|
||||||
|
|
||||||
|
```bash
|
||||||
|
hello PyConES17
|
||||||
|
```
|
BIN
images/mailgun/1.jpg
Normal file
BIN
images/mailgun/1.jpg
Normal file
Binary file not shown.
After Width: | Height: | Size: 286 KiB |
BIN
images/mailgun/2.jpg
Normal file
BIN
images/mailgun/2.jpg
Normal file
Binary file not shown.
After Width: | Height: | Size: 54 KiB |
BIN
images/mailgun/3.jpg
Normal file
BIN
images/mailgun/3.jpg
Normal file
Binary file not shown.
After Width: | Height: | Size: 175 KiB |
BIN
images/mailgun/4.jpg
Normal file
BIN
images/mailgun/4.jpg
Normal file
Binary file not shown.
After Width: | Height: | Size: 240 KiB |
BIN
images/mailgun/5.jpg
Normal file
BIN
images/mailgun/5.jpg
Normal file
Binary file not shown.
After Width: | Height: | Size: 299 KiB |
BIN
images/title.png
Normal file
BIN
images/title.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 80 KiB |
Loading…
Reference in New Issue
Block a user