{ "info": { "author": "Michael Maurizi", "author_email": "michael@maurizi.org", "bugtrack_url": null, "classifiers": [], "description": "===========================\ndjango-async-messages-redux\n===========================\n\nSimple asynchronous messages for django. Plays nicely with Celery.\nFork of https://github.com/codeinthehole/django-async-messages\n\nQuestions\n=========\n\nWhat problem does this solve?\n-----------------------------\n\nSuppose a user instigates an expensive task that you are processing offline (eg\nusing Celery). This library provides a simple mechanism for notifying the user\nwhen the task is finished, utilising Django's messaging framework.\n\nWhat's an example?\n------------------\n\nYou might use Celery to generate a large report and then employ this library to\nnotify the user that their report is ready to be downloaded. The user will see\nthe message you've sent them when they make their next request after the message\nis submitted.\n\nHow does it work?\n-----------------\n\nA cache is used to persist the messages, and middleware is used to pick these up\nand submit them to `Django's messaging framework`_. All very simple.\n\n.. _`Django's messaging framework`: https://docs.djangoproject.com/en/dev/ref/contrib/messages/\n\nWhat's good about this implementation?\n--------------------------------------\n\n* It's simple, fast and easy to use.\n* It works cohesively with existing Django cache and messages framework. It\n will work no matter what cache backend your are using, and whatever storage\n backend is used for messages.\n\nWhat's bad?\n-----------\n\n* A user may miss the message if they navigating quickly between pages. But \n this is a general problem of the Django messages framework.\n\nInstall\n=======\n\nFrom PyPI (stable)::\n\n pip install django-async-messages-redux\n\nAdd ``'async_messages.middleware.AsyncMiddleware'`` to your ``MIDDLEWARE`` or ``MIDDLEWARE_CLASSES``.\nEnsure it comes after ``'django.contrib.messages.middleware.MessageMiddleware'``.\n\nYou need to have ``CACHES`` configured in you settings for this to work. As usual,\nmemcache is the best choice. Note that `local memory caching`_ is not suitable as\neach process has its own private cache and a Celery task can't communicate with\nthe webserver process cache.\n\n.. _`local memory caching`: https://docs.djangoproject.com/en/dev/topics/cache/#local-memory-caching\n\nUse\n===\n\nSend a message to a single user::\n\n >>> from async_messages import message_user\n >>> from django.contrib.auth.models import User\n >>> barry = User.objects.get(username='barry')\n >>> message_user(barry, \"Barry, your report is ready\") \n\nSend a message to lots of users::\n\n >>> from async_messages import message_users\n >>> staff = User.objects.filter(is_staff=True)\n >>> message_users(staff, \"All budgets must be spent by the end of the day\")\n\nSpecify message level::\n\n >>> from django.contrib.messages import constants\n >>> message_users(staff, \"Boom!\", constants.WARNING)\n\nSend multiple messages to a single user::\n\n >>> from async_messages import message_user\n >>> from django.contrib.auth.models import User\n >>> barry = User.objects.get(username='barry')\n >>> message_user(barry, \"Barry, your report is queued up for processing\") \n >>> # do more awesome stuff\n >>> message_user(barry, \"Barry, your report is ready\") \n\nAlternative way to send a message to a single user, imitating the django.contrib.messages API::\n\n >>> from async_messages import messages\n >>> barry = User.objects.get(username='barry')\n >>> messages.debug(barry, \"Barry was here\")\n >>> messages.info(barry, \"Hi, Barry\")\n >>> messages.success(barry, \"Barry, your report is ready\")\n >>> messages.warning(barry, \"Barry, you didn't lock your session\")\n >>> messages.error(barry, \"You are not Barry\")\n\nContributing\n============\n\nFork, clone and create a virtualenv. Then run::\n\n make install\n\nRun tests with::\n\n python manage.py test tests\n\nPlease submit pull requests using 'develop' as the target branch.\n\nLicense\n=======\n\nMIT_\n\n.. _MIT: http://en.wikipedia.org/wiki/MIT_License\n\nChangelog\n=========\n\n0.4.1\n-----\n* Improvements to Django 2+ and Python 3+ support\n\n0.4.0\n-----\n* Forked, added support for up to Django 2.0\n\n0.3.1\n-----\n* Fix bug around request instances that don't have a user attribute\n\n0.3\n---\n* Mimic ``django.contrib.messages`` API for sending a message to a user\n\n0.2\n---\n* Added possibility to queue multiple messages\n\n0.1.2\n-----\n* Altered dependency on Django to be only 1.2+\n\n0.1.1\n-----\n* Altered middleware to use ``process_response``.\n* Better docstrings\n\n0.1\n---\n* Minimum viable product\n\n\n", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/maurizi/django-async-messages", "keywords": "", "license": "", "maintainer": "", "maintainer_email": "", "name": "django-async-messages-redux", "package_url": "https://pypi.org/project/django-async-messages-redux/", "platform": "", "project_url": "https://pypi.org/project/django-async-messages-redux/", "project_urls": { "Homepage": "https://github.com/maurizi/django-async-messages" }, "release_url": "https://pypi.org/project/django-async-messages-redux/0.4.1/", "requires_dist": [ "django (>=1.4)" ], "requires_python": "", "summary": "Send asynchronous messages to users (eg from offline scripts). Useful for integration with Celery.", "version": "0.4.1" }, "last_serial": 4279753, "releases": { "0.4.0": [ { "comment_text": "", "digests": { "md5": "4ab71b49fa99135e9c316615dbd67a60", "sha256": "1bb05641cbb9427a1218e9eb962b60687f44efa581e16616bd23892677f327ba" }, "downloads": -1, "filename": "django_async_messages_redux-0.4.0-py2-none-any.whl", "has_sig": false, "md5_digest": "4ab71b49fa99135e9c316615dbd67a60", "packagetype": "bdist_wheel", "python_version": "py2", "requires_python": null, "size": 7418, "upload_time": "2018-02-10T15:41:01", "url": "https://files.pythonhosted.org/packages/1d/1f/80d77ad7803e3072f151e2c0cd977374f8e8de952b1e56531f997afb8be8/django_async_messages_redux-0.4.0-py2-none-any.whl" }, { "comment_text": "", "digests": { "md5": "46fbe480c8c81e36538351b9e1966698", "sha256": "692f10ba7ccea168fd25a9cb8d3f04145dcc61e8427ba14f1af45a37dc1473c3" }, "downloads": -1, "filename": "django_async_messages_redux-0.4.0-py3-none-any.whl", "has_sig": false, "md5_digest": "46fbe480c8c81e36538351b9e1966698", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 7418, "upload_time": "2018-02-10T16:05:15", "url": "https://files.pythonhosted.org/packages/95/ed/73d24a598f00714bf5564ae2d957dc6dc5f19710a8f175a1a60763da70d7/django_async_messages_redux-0.4.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "dc84c81cf5c3834dade59a1fab119742", "sha256": "783142e72e8cb1893b5c9d3549c059103c2e61587c5f4baa671c72fd2111413e" }, "downloads": -1, "filename": "django-async-messages-redux-0.4.0.tar.gz", "has_sig": false, "md5_digest": "dc84c81cf5c3834dade59a1fab119742", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4352, "upload_time": "2018-02-10T16:03:52", "url": "https://files.pythonhosted.org/packages/3a/9e/3eb1ed1ad2209d903ddc3ecce50f4e9ba23fed0481cdfe51a146518dba39/django-async-messages-redux-0.4.0.tar.gz" } ], "0.4.1": [ { "comment_text": "", "digests": { "md5": "979e2eb3be78d1245f051793b5c5fa88", "sha256": "38c35b741bb235b474a00791b31bd14ec07d61ec845b9b2e0ca60baae5e2d67b" }, "downloads": -1, "filename": "django_async_messages_redux-0.4.1-py2-none-any.whl", "has_sig": false, "md5_digest": "979e2eb3be78d1245f051793b5c5fa88", "packagetype": "bdist_wheel", "python_version": "py2", "requires_python": null, "size": 7512, "upload_time": "2018-09-17T15:06:37", "url": "https://files.pythonhosted.org/packages/58/f2/143acebef4643cf1c8f1514cab7b33d2b177d8a7afde365f0d3254c9fa0d/django_async_messages_redux-0.4.1-py2-none-any.whl" }, { "comment_text": "", "digests": { "md5": "b25d7cfaef93b22fe33adf5b87042dac", "sha256": "ff72d5070e9c2a1073c8661fd4a05b65c4c57c1c2f85d97a3d9d0cd83e0c4769" }, "downloads": -1, "filename": "django_async_messages_redux-0.4.1-py3-none-any.whl", "has_sig": false, "md5_digest": "b25d7cfaef93b22fe33adf5b87042dac", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 7551, "upload_time": "2018-09-17T15:06:38", "url": "https://files.pythonhosted.org/packages/a3/42/9f7164c17687f886e143c75f8e41e179f442529cb75d4c8294966e5a0e8f/django_async_messages_redux-0.4.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "a95b464d0517435d19fc743d66ec46d1", "sha256": "5ec913fdf70ca6657b59ab681c0d1b84892043e8c0785cc2ad313f721d414f86" }, "downloads": -1, "filename": "django-async-messages-redux-0.4.1.tar.gz", "has_sig": false, "md5_digest": "a95b464d0517435d19fc743d66ec46d1", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4463, "upload_time": "2018-09-17T15:06:39", "url": "https://files.pythonhosted.org/packages/d2/81/f1887e4494222c80b3d6d96506924901bd0349f7678879c53e2f22992a36/django-async-messages-redux-0.4.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "979e2eb3be78d1245f051793b5c5fa88", "sha256": "38c35b741bb235b474a00791b31bd14ec07d61ec845b9b2e0ca60baae5e2d67b" }, "downloads": -1, "filename": "django_async_messages_redux-0.4.1-py2-none-any.whl", "has_sig": false, "md5_digest": "979e2eb3be78d1245f051793b5c5fa88", "packagetype": "bdist_wheel", "python_version": "py2", "requires_python": null, "size": 7512, "upload_time": "2018-09-17T15:06:37", "url": "https://files.pythonhosted.org/packages/58/f2/143acebef4643cf1c8f1514cab7b33d2b177d8a7afde365f0d3254c9fa0d/django_async_messages_redux-0.4.1-py2-none-any.whl" }, { "comment_text": "", "digests": { "md5": "b25d7cfaef93b22fe33adf5b87042dac", "sha256": "ff72d5070e9c2a1073c8661fd4a05b65c4c57c1c2f85d97a3d9d0cd83e0c4769" }, "downloads": -1, "filename": "django_async_messages_redux-0.4.1-py3-none-any.whl", "has_sig": false, "md5_digest": "b25d7cfaef93b22fe33adf5b87042dac", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 7551, "upload_time": "2018-09-17T15:06:38", "url": "https://files.pythonhosted.org/packages/a3/42/9f7164c17687f886e143c75f8e41e179f442529cb75d4c8294966e5a0e8f/django_async_messages_redux-0.4.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "a95b464d0517435d19fc743d66ec46d1", "sha256": "5ec913fdf70ca6657b59ab681c0d1b84892043e8c0785cc2ad313f721d414f86" }, "downloads": -1, "filename": "django-async-messages-redux-0.4.1.tar.gz", "has_sig": false, "md5_digest": "a95b464d0517435d19fc743d66ec46d1", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4463, "upload_time": "2018-09-17T15:06:39", "url": "https://files.pythonhosted.org/packages/d2/81/f1887e4494222c80b3d6d96506924901bd0349f7678879c53e2f22992a36/django-async-messages-redux-0.4.1.tar.gz" } ] }