Skip to content

Instantly share code, notes, and snippets.

@kennethreitz
Created June 9, 2012 15:38
Show Gist options
  • Save kennethreitz/2901479 to your computer and use it in GitHub Desktop.
Save kennethreitz/2901479 to your computer and use it in GitHub Desktop.
My typical flask app base
# -*- 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