export OPENFAAS_URL
# list available templates
faas new --list
faas new --lang <template name> <function name>
faas build -f
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
| model_id - 5cc72c4a96b2d57bb60ca758 | |
| partner_script_id - 5a164fc4f7a57932dd40d9a7 |
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
| from celery import Celery | |
| from flask import Flask, jsonify, request, render_template | |
| def make_celery(app): | |
| celery = Celery(app.import_name, | |
| broker=app.config['CELERY_BROKER_URL'], | |
| backend=app.config['CELERY_RESULT_BACKEND']) | |
| celery.conf.update(app.config) | |
| TaskBase = celery.Task |
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
| from flask import Flask, jsonify, request, render_template | |
| app = Flask(__name__) | |
| @app.route('/page/<name>/') | |
| def page(name): | |
| return render_template('hello.html', name=name) | |
| @app.route('/api/get/') |
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
| class Jug: | |
| def __init__(self): | |
| self.exception_handlers = {} | |
| def errorhandler(self, exception): | |
| def decorator(f): | |
| self.exception_handlers[exception] = f | |
| return f | |
| return decorator |
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
| from django.db import connection | |
| from django.test import TestCase | |
| from ..behaviors import WalletIntegration | |
| class TestModel(WalletIntegration): | |
| class Meta: | |
| app_label = 'test' |
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
| import logging | |
| # Just a simple way to output or print data on the console's stdout | |
| logger = logging.getLogger('django') | |
| logger.info("TEST") |
Just a compilation of links for syslog reference.
NewerOlder