Example #1
0
import heroku
import requests

from flask import Flask, request, Response
from flask.ext.celery import Celery
from raven.contrib.flask import Sentry

import urllib


app = Flask(__name__)

redis_url = os.environ.get("REDISTOGO_URL", "redis://localhost:6379/0")

app.config["BROKER_URL"] = redis_url
app.config["CELERY_ENABLE_UTC"] = True
app.config["CELERYD_POOL"] = "gevent"

celery = Celery(app)
# sentry = Sentry(app)

HEROKU_EMAIL = os.environ.get("HEROKU_EMAIL")
HEROKU_PASS = os.environ.get("HEROKU_PASS")

heroku = heroku.from_pass(HEROKU_EMAIL, HEROKU_PASS)


@celery.task(name="yoshi.install")
def install(package, connect=False):

    # Create temp git directory.
Example #2
0
from celery import Celery

base_dir = os.path.dirname(os.path.realpath(__file__))
execfile(base_dir + "/gdatabase.py")
execfile(base_dir + "/email_helper.py")

from twilio.rest import TwilioRestClient

client = TwilioRestClient(twilio_AccountSID, twilio_AuthToken)

wsdlfile = "http://phone.ehhapp.org/services.php?wsdl"

app = Flask(__name__, static_folder="")
app.config["CELERY_BROKER_URL"] = "redis://localhost:6379/0"
app.config["CELERY_RESULT_BACKEND"] = "redis://localhost:6379/0"
app.config["CELERY_ENABLE_UTC"] = False
app.debug = True

celery = Celery(app.name, broker=app.config["CELERY_BROKER_URL"])
celery.conf.update(app.config)

# user/pass to log into Twilio to retrieve files
auth_combo = HTTPBasicAuth(twilio_AccountSID, twilio_AuthToken)


@app.route("/", methods=["GET", "POST"])
def hello_ehhop():
    """respond to incoming requests:"""

    # Gracias por llamar a la Clinica de EHHOP.
    # Para instrucciones en espanol, marque el numero 2.