-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
44 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
from flask import Flask | ||
from flask.ext.sqlalchemy import SQLAlchemy | ||
import settings | ||
|
||
app = Flask(__name__) | ||
app.config['SQLALCHEMY_DATABASE_URI'] = settings.DB_URI | ||
db = SQLAlchemy(app) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
from app import db, app | ||
from flask import url_for | ||
from flask.ext.sqlalchemy import SQLAlchemy, BaseQuery | ||
|
||
|
||
#Model | ||
class User(db.Model): | ||
id = db.Column(db.Integer, primary_key=True) | ||
firstName = db.Column(db.String(100)) | ||
searchingForName = db.Column(db.String(120)) | ||
message = db.Column(db.Text) | ||
phoneNumber = db.Column(db.String(30)) | ||
|
||
def __init__(self, firstName, searchingForName, message, phoneNumber): | ||
self.firstName = firstName | ||
self.searchingForName = searchingForName | ||
self.message = message | ||
self.phoneNumber = phoneNumber | ||
|
||
def __repr__(self): | ||
return '<User %r is searching for %r>' % (self.firstName, self.searchingForName) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
#!flask/bin/python | ||
from app import app |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
from app import db | ||
from flask import request | ||
import twilio.twiml | ||
|
||
|
||
@app.route("/", methods= ["GET", "POST"]) | ||
def replyToSms(): | ||
messageBody = request.form.get('Body') | ||
resp = twilio.twiml.Response() | ||
resp.message("What is your Name?") | ||
return str(resp), 200, {"Content-Type":"application/xml; charset=utf-8"} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,2 @@ | ||
from flask import Flask | ||
from flask import request | ||
import twilio.twiml | ||
|
||
app = Flask(__name__) | ||
|
||
@app.route("/", methods= ["GET", "POST"]) | ||
def replyToSms(): | ||
messageBody = request.form.get('Body') | ||
resp = twilio.twiml.Response() | ||
resp.message("What is your Name?") | ||
return str(resp), 200, {"Content-Type":"application/xml; charset=utf-8"} | ||
|
||
if __name__ == "__main__": | ||
app.run(debug=True) | ||
from app import app | ||
app.run(port=5000, debug=True) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters