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
DATABASES = { | |
'default': { | |
'ENGINE': 'zappa_django_utils.db.backends.s3sqlite', | |
'NAME': 'sqlite.db', | |
'BUCKET': 'your-db-bucket' | |
} | |
} |
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
zappa invoke --raw 'import subprocess; print subprocess.check_output("ls");' |
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
class User(object): | |
name = None | |
age = None | |
def print_name(self): | |
print "Hi, I'm " + self.name + "!" | |
new_user = User() | |
new_user.name = "Jeff" | |
new_user.age = 19 |
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
from nodb import NoDB | |
nodb = NoDB() | |
nodb.bucket = "my-s3-bucket" | |
nodb.index = "name" | |
# Save an object! | |
user = {"name": "Jeff", "age": 19} | |
nodb.save(user) # True |
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
from zappa.async import run | |
run(your_function, args, kwargs) # Using Lambda | |
run(your_function, args, kwargs, service='sns') # Using SNS |
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
{ | |
"dev": { | |
.. | |
"async_source": "sns", // Source of async tasks. Defaults to "lambda" | |
"async_resources": true, // Create the SNS topic to use. Defaults to true. | |
.. | |
} | |
} |
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
from zappa.async import task_sns | |
@task_sns |
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
import flask | |
from zappa.async import task | |
@task | |
def make_pie(): | |
""" This takes a long time! """ | |
ingredients = get_ingredients() | |
pie = bake(ingredients) | |
deliver(pie) |
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
<!-- Start of Async Drift Code --> | |
<script> | |
var YOUR_CODE = 'BLAH_BLAH_BLAH'; | |
!function() { | |
var t; | |
if (t = window.driftt = window.drift = window.driftt || [], !t.init) return t.invoked ? void (window.console && console.error && console.error("Drift snippet included twice.")) : (t.invoked = !0, | |
t.methods = [ "identify", "config", "track", "reset", "debug", "show", "ping", "page", "hide", "off", "on" ], | |
t.factory = function(e) { | |
return function() { | |
var n; |
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
<!DOCTYPE HTML> | |
<html> | |
<head> | |
<meta charset="utf-8" /> | |
<title>Semantic UI CDN</title> | |
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/semantic-ui/2.2.9/semantic.min.css"/> | |
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script> | |
<script src="https://cdnjs.cloudflare.com/ajax/libs/semantic-ui/2.2.9/semantic.min.js"></script> | |
</head> | |
<body> |