A small extension framework for Flask to easy a series of simple tasks.
List the complete set of changes to the quorum project since it’s creation.
- Better signature for quorum.send_mail()
- Improved asynchronous mode under quorum.send_mail_a()
- New support for quorum.delete_amazon_key() calls
0.1.5
- Initial support for mongodb
0.1.4
- Legacy support values
0.1.3
- Legacy support values
0.1.1
- Legacy support values
0.1.0
- Initial release
- First specification of the framework
If the application should be ran under the run mode.
Hostname or IP address of the server to be used as gateway for sending smtp messages (e-mails) under quorum.
This value may contain an optional port value separated by a : character.
Username to be used in the authentication process on the SMTP connections used for sending email messages.
Note
Most of the times the username is an email address and as such it’s also used as the default fallback value for the sender value for outgoing emails.
Password to be used in the authentication process on the SMTP connections used for sending email messages.
The url to be used for the establishment of connection to the MongoDB server. It must contain authentication information, host, port and optionally the default database to be used.
Note
An example url for mongo would be something like mongodb://root:root@db.hive:27017.
The reference to the top level application object that is being handled by quorum. This value is used across the quorum infra-structure to access flask data and capabilities.
Note
Changing this value directly should be done with care as it may create undesired results. To set/start this value use the quorum.load() function instead.
Initial loader function responsible for the overriding of the flask loading system and for the loading of configuration.
Note
This function should be called inside you main app file failure to do so may result in unexpected behavior.
Parameters: |
|
---|---|
Return type: | Application |
Returns: | The application that is used by the loaded quorum environment in case one was provided that is retrieved, otherwise the newly created one is returned instead. |
Unloads the current quorum instance, after this call no more access to the quorum facilities is allowed.
Warning
Use this function with care as it may result in unexpected behavior from a developer point of view.
Note
After the call to this method most of the functionally of quorum will become unavailable until further call to quorum.load().
Sends an email message using the provided SMTP_HOST SMTP_USER and SMTP_PASSWORD configurations.
The email message is sent under the alternative mime type so that both the plain text and the rich text (html) parts are sent in the same message.
The plain and rich arguments allow the user to process a template with the context provided by the context map.
Warning
This is a blocking call and as such the control flow may block for more that a second, if you want a non blocking (asynchronous) call please use quorum.send_mail_a().
Parameters: |
|
---|
Asynchronous call to the quorum.send_mail() function that is executed in a different thread from the current one. The currently loaded queue system is used for the sending of the email, for more information check on quorum.run_background() .
Note
The arguments to be send for this function are the same as the one present in the original quorum.send_mail() function.
Return an iterator that yields tuples of an index and an item of the
import flask
import quorum
app = quorum.load(
name = __name__
)
@app.route("/", methods = ("GET",))
def index():
return flask.render_template("index.html.tpl")
if __name__ == "__main__":
quorum.run()