{ "info": { "author": "James Robert", "author_email": "jiaaro@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Environment :: Web Environment", "Framework :: Django", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python", "Topic :: Internet :: WWW/HTTP", "Topic :: Utilities" ], "description": "`pingpong` is a library to aimed at simplifying things thing that should be easy \nin django.\n\n## Installation ##\n\n 1. Install lib with pip:\n \n `pip install pingpong`\n \n **- OR -**\n\n Put the \"pingpong\" directory somewhere in your python path\n\n 2. Add \"pingpong\" to your installed apps (in the settings.py file)\n\n## A better way to fire off emails\n\n from pingpong.email import render_to_email\n \n def some_function():\n \n template = \"emails/muffins.email\"\n context = { \"your_mom\": \"Betty Crocker\", \"muffin_type\": \"blueberry\" }\n recipients = ['somebody@example.com']\n \n # send an email!\n render_to_email(template, context, recipients)\n \nAnd the template, `emails/my_email_template.email` would be in your main \ntemplates folder:\n\n Delicious muffins thanks to {{ your_mom }}\n \n \n Hi friend,\n \n I'm writing to let you know that {{ your_mom }} made some superb \n {{ muffin_type }} muffins. Please tell her thank you!\n \n Thanks,\n A Robot\n \nThe first non-blank line is the subject, everything following is the message.\n\nSubject: \n\n Delicious muffins thanks to Betty Crocker\n\nMessage:\n\n I'm writing to let you know that Betty Crocker made some superb \n blueberry muffins. Please tell her thank you!\n \n Thanks,\n A Robot\n\nWhitespace is stripped from the beginning and end of the message.\n\n## Passing system events to your app\n\nset up listeners:\n\n # listeners.py\n \n from pingpong.utils import pong\n \n @pong(\"dailycron\")\n def email_admins_about_daily_activity(ping_name, args, kwargs, **kw):\n ...\n \n \n # models.py\n \n ... your models...\n \n import listeners\n \nThen you trigger all functions listening to \"dailycron\" like so:\n\n $ python manage.py pong dailycron\n \nIf you pass extra args to the management command they will get passed along...\n\n $ python manage.py pong cachecleared memcache:38174\n \nIn this case we're letting the app know that memcache on port 38174 just got\ncleared.\n\n from pingpong.utils import pong\n \n @pong(\"cachecleared\")\n def warm_up_cache(ping_name, args, kwargs, **kw):\n assert ping_name == \"cachecleared\"\n assert args[0] == \"memcache:38174\"\n \n cache_type, port = args[0].split(\":\")\n ...", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "UNKNOWN", "keywords": "django", "license": "MIT", "maintainer": null, "maintainer_email": null, "name": "pingpong", "package_url": "https://pypi.org/project/pingpong/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/pingpong/", "project_urls": { "Download": "UNKNOWN", "Homepage": "UNKNOWN" }, "release_url": "https://pypi.org/project/pingpong/0.0.1/", "requires_dist": null, "requires_python": null, "summary": "Django library that makes triggering emails easier", "version": "0.0.1" }, "last_serial": 796263, "releases": { "0.0.1": [ { "comment_text": "", "digests": { "md5": "5771f86dbb5d3566aad8c5e47e1e1ee0", "sha256": "3123d85078fff1f2c318c6ca5edfec61c4eb69b13aa1711cb29f62d761d6521a" }, "downloads": -1, "filename": "pingpong-0.0.1.tar.gz", "has_sig": false, "md5_digest": "5771f86dbb5d3566aad8c5e47e1e1ee0", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3348, "upload_time": "2012-07-11T02:24:50", "url": "https://files.pythonhosted.org/packages/1b/56/c2631153d8425adbc68261df789ee1e8637e44c2c512293ee736f2f4fcf0/pingpong-0.0.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "5771f86dbb5d3566aad8c5e47e1e1ee0", "sha256": "3123d85078fff1f2c318c6ca5edfec61c4eb69b13aa1711cb29f62d761d6521a" }, "downloads": -1, "filename": "pingpong-0.0.1.tar.gz", "has_sig": false, "md5_digest": "5771f86dbb5d3566aad8c5e47e1e1ee0", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3348, "upload_time": "2012-07-11T02:24:50", "url": "https://files.pythonhosted.org/packages/1b/56/c2631153d8425adbc68261df789ee1e8637e44c2c512293ee736f2f4fcf0/pingpong-0.0.1.tar.gz" } ] }