This file contains hidden or 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 |
This file contains hidden or 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
ACCESS_KEY='YOUR AMAZON API KEY' | |
SECRET='YOUR AMAZON SECRET' | |
BUCKET_NAME='database_backup_bucket' #note that you need to create this bucket first | |
from boto.s3.connection import S3Connection | |
from boto.s3.key import Key | |
def save_file_in_s3(filename): | |
conn = S3Connection(ACCESS_KEY, SECRET) | |
bucket = conn.get_bucket(BUCKET_NAME) |
This file contains hidden or 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
""" | |
'How to do basic authentication on twisted web', from here: | |
http://twistedmatrix.com/pipermail/twisted-python/2009-August/020236.html | |
Original Copyright (c) 2008 Twisted Matrix Laboratories. See LICENSE for details. | |
Which I modified to use Twisted's Application framework. | |
USAGE | |
----- | |
1) Make htpasswd file: |