Add analytics on push and pull repo events in the backend.
This commit is contained in:
parent
e5d100842d
commit
00b8244661
5 changed files with 32 additions and 35 deletions
10
app.py
10
app.py
|
@ -6,16 +6,24 @@ from flask import Flask
|
|||
from flask.ext.principal import Principal
|
||||
from flask.ext.login import LoginManager
|
||||
from flask.ext.mail import Mail
|
||||
|
||||
from config import ProductionConfig, DebugConfig, LocalHostedConfig
|
||||
from util import analytics
|
||||
|
||||
|
||||
app = Flask(__name__)
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
stack = os.environ.get('STACK', '').strip().lower()
|
||||
if stack.startswith('prod'):
|
||||
logger.info('Running with production config.')
|
||||
config = ProductionConfig()
|
||||
elif stack.startswith('localhosted'):
|
||||
logger.info('Running with debug config on production data.')
|
||||
config = LocalHostedConfig()
|
||||
else:
|
||||
logger.info('Running with debug config.')
|
||||
config = DebugConfig()
|
||||
|
||||
app.config.from_object(config)
|
||||
|
@ -32,3 +40,5 @@ mail = Mail()
|
|||
mail.init_app(app)
|
||||
|
||||
stripe.api_key = app.config['STRIPE_SECRET_KEY']
|
||||
|
||||
mixpanel = analytics.init_app(app)
|
||||
|
|
Reference in a new issue