Example #1
0
File: main.py Project: jackij/FPWeb
  level=logging.DEBUG,
  )
log = logging.getLogger('neuropost')
log.info('Starting neuropost')
from flask import Flask
from database import db
from login_stuff import login_manager, oid
from urls import everything
from database import MYSQL_CONN
from sooper_sekrit import MYSQL_CONN_INFO, sekrit


TESTING = True


app = Flask(__name__)
app.secret_key = sekrit
app.config['SQLALCHEMY_DATABASE_URI'] = MYSQL_CONN % MYSQL_CONN_INFO
#app.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite:////tmp/test.db'
app.config['SQLALCHEMY_POOL_RECYCLE'] = 60 * 60 # Once an hour.
app.debug = TESTING

db.init_app(app)
login_manager.setup_app(app)
oid.init_app(app)


for urls in everything:
  log.info('Mapping URLs')
  urls(app)
  log.info('Mapping URLs finished.')
from sqlalchemy import or_
import os
import rauth # OAuth for Yelp
from pygeocoder import Geocoder
from math import erf, sqrt
import json
from operator import attrgetter

app = Flask(__name__)

app.secret_key = 'iwillneverhavetorecall12032'
app.debug = True
# configure SQLAlchemy
app.config['SQLALCHEMY_DATABASE_URI'] = os.environ['DATABASE_URL']
app.config['TRAP_BAD_REQUEST_ERRORS'] = True
app.config['SQLALCHEMY_POOL_RECYCLE'] = 30
# Email
app.config['MAIL_SERVER'] = 'smtp.googlemail.com'
app.config['MAIL_PORT'] = 465
app.config['MAIL_USE_TLS'] = False
app.config['MAIL_USE_SSL'] = True
app.config['MAIL_USERNAME'] = 'vetcompare'
app.config['MAIL_PASSWORD'] = 'bestvet.com'

# API Keys
# Yelp
yelp_consumer_key = "mxc7iaic-fTArlp9TzlDdQ"
yelp_consumer_secret = "m4K6l7_vZZm8QAOEHTqUXiqEon4"
yelp_token = "lYpeNoecLXLbH7FGD96waKqRQpsBtCOI"
yelp_token_secret = "-vi4CSK58xt4HfxaoA82_BGZ01Q"