Commit 46a578e4 by stellaaachen

flask app

parent eac389de
Showing with 104 additions and 0 deletions
{
"cells": [
{
"cell_type": "code",
"execution_count": 1,
"metadata": {},
"outputs": [],
"source": [
"import flask\n",
"from flask import Flask, request, jsonify\n",
"import smtplib\n",
"from email.message import EmailMessage"
]
},
{
"cell_type": "code",
"execution_count": 2,
"metadata": {},
"outputs": [],
"source": [
"app = Flask(__name__)"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "code",
"execution_count": 3,
"metadata": {},
"outputs": [],
"source": [
"with app.test_client() as c:\n",
" rv = c.post('/emails', json={\n",
" 'email': 'stellaqc@uchicago.edu'})"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
" * Serving Flask app \"__main__\" (lazy loading)\n",
" * Environment: production\n",
"\u001b[31m WARNING: This is a development server. Do not use it in a production deployment.\u001b[0m\n",
"\u001b[2m Use a production WSGI server instead.\u001b[0m\n",
" * Debug mode: off\n"
]
},
{
"name": "stderr",
"output_type": "stream",
"text": [
" * Running on http://127.0.0.1:5000/ (Press CTRL+C to quit)\n",
"127.0.0.1 - - [11/Nov/2021 11:01:09] \"\u001b[33mGET / HTTP/1.1\u001b[0m\" 404 -\n",
"127.0.0.1 - - [11/Nov/2021 11:01:10] \"\u001b[33mGET /favicon.ico HTTP/1.1\u001b[0m\" 404 -\n",
"127.0.0.1 - - [11/Nov/2021 11:01:13] \"\u001b[33mGET /emails HTTP/1.1\u001b[0m\" 404 -\n",
"127.0.0.1 - - [11/Nov/2021 11:01:16] \"\u001b[33mGET /emails HTTP/1.1\u001b[0m\" 404 -\n"
]
}
],
"source": [
"if __name__ == \"__main__\":\n",
" app.run()"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.7.6"
}
},
"nbformat": 4,
"nbformat_minor": 4
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment