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
#!/usr/bin/python2.7 | |
import sys | |
import requests | |
import json | |
contents = json.loads(open('.httprc').read()) | |
url_prefix = contents['url_prefix'] | |
method = sys.argv[1].lower() | |
url = sys.argv[2] |
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
<form novalidate action="{% url 'thing_create' %}" method="POST" id="thing-form"> | |
{% csrf_token %} | |
{{ form }} | |
<input type="submit" value="Submit" /> | |
</form> |
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 tenacity import retry, stop_after_attempt, wait_exponential | |
@retry(reraise=True, stop=stop_after_attempt(5), wait=wait_exponential(multiplier=1, min=4, max=10)) | |
def do_something_flaky(succeed): | |
print('Doing something flaky') | |
if not succeed: | |
print('Failed!') | |
raise Exception('Failed!') |