Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Stella Chen
/
classhook_contact
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Pipelines
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
46a578e4
authored
Nov 11, 2021
by
stellaaachen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
flask app
parent
eac389de
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
104 additions
and
0 deletions
contact.ipynb
contact.ipynb
View file @
46a578e4
{
"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
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment