Skip to content

Commit

Permalink
Update email credentials
Browse files Browse the repository at this point in the history
  • Loading branch information
rbs333 committed Dec 11, 2018
1 parent efbd783 commit d5bf015
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
5 changes: 2 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,10 @@ conda install flask waitress

For development, `cd` to the project folder, then use `python myapp.py` to start the server.

Next in a different terminal `cd` into the `frontend` folder and run `npm run dev` to start the client

A Waitress production server can be started by `python production.py`.


Nate
I made a change. -Hannah
Fangzhou


11 changes: 7 additions & 4 deletions myapp.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
from flask import Flask, render_template, request, send_from_directory, jsonify, send_file
from algorithm.tsp import tsp
from algorithm.s_bfl import s_bfl
from email_credentials import credentials
from flask_mail import Mail
from flask_mail import Message
from flask_cors import CORS
Expand All @@ -26,13 +27,17 @@ class CustomFlask(Flask):
app = CustomFlask(__name__,template_folder='') # This replaces your existing "app = Flask(__name__)"
CORS(app)

c = credentials()
c.setPassword()


app.config.update(
DEBUG = True,
MAIL_SERVER = 'smtp.gmail.com',
MAIL_PORT = 465,
MAIL_USE_SSL = True,
MAIL_USERNAME = '[email protected]',
MAIL_PASSWORD = 'awkfxsasolaunvtf',
MAIL_PASSWORD = c.password,
)

mail = Mail(app)
Expand All @@ -51,9 +56,7 @@ def Sbfl():
sender="[email protected]",
recipients=["[email protected]"])
msg.body = "Thanks for using SBFLS! Attached are our results."
# with app.open_resource("./algorithm/example_output.yaml") as fp:
# msg.attach("./algorthm/example_output.yaml", "yaml", fp.read())
# mail.send(msg)
mail.send(msg)
return response

@app.errorhandler(404)
Expand Down

0 comments on commit d5bf015

Please sign in to comment.