Created
June 9, 2012 15:38
-
-
Save kennethreitz/2901479 to your computer and use it in GitHub Desktop.
My typical flask app base
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
# -*- coding: utf-8 -*- | |
import os | |
from flask import Flask | |
from flask_heroku import Heroku | |
from flask_sslify import SSLify | |
from raven.contrib.flask import Sentry | |
from flask.ext.celery import Celery | |
app = Flask(__name__) | |
app.secret_key = os.environ.get('APP_SECRET', 'some-secret-key') | |
app.debug = 'DEBUG' in os.environ | |
# Use gevent workers for celery. | |
app.config['CELERYD_POOL'] = 'gevent' | |
# Bootstrap Heroku environment variables. | |
heroku = Heroku(app) | |
# Redirect urls to https | |
sslify = SSLify(app) | |
# Setup error collection | |
sentry = Sentry(app) | |
# Task queue | |
celery = Celery(app) | |
@app.route('/') | |
def hello_world(): | |
return 'Hello World!' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment