{ "info": { "author": "Michael Beaton", "author_email": "michael@beatonma.org", "bugtrack_url": null, "classifiers": [ "Framework :: Django", "Intended Audience :: Developers", "License :: OSI Approved :: GNU General Public License v3 (GPLv3)", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7" ], "description": "Mentions\n========\n\nMentions lets you add Webmention_ functionality to any Django model with minimal\nsetup. There is an implementation running at https://django-wm.dev/ with source\ncode available here_.\n\n.. _webmention: https://indieweb.org/Webmention\n.. _here: https://github.com/beatonma/django-wm-example\n\n\nInstallation\n============\n:code:`pip install django-wm`\n\n\nSetup\n=====\n\nCelery\n------\nMentions uses Celery_ and RabbitMQ_ for running tasks asynchronously.\nIf you do not use them already you will need to set them up first.\n\n.. _Celery: http://www.celeryproject.org\n.. _RabbitMQ: https://www.rabbitmq.com\n\n\nSystem::\n\n sudo apt install rabbitmq-server\n\n # Create user for celery service and make sure it can access your database\n # e.g:\n sudo useradd -N -M --system -s /bin/bash celery\n sudo usermod -a -G www-data celery\n\n # Run celery\n sudo -u celery env/bin/celery -A projectname worker &\n\n\nProject:\n\n Add :code:`celery.py` to your root project. For an example implementation\n see celery.py_ from the example project.\n\n.. _celery.py: https://github.com/beatonma/django-wm-example/blob/master/example/celery.py\n\n\nProject code\n------------\n\n1. Root project :code:`settings.py`:\n\n * Set :code:`DOMAIN_NAME`::\n\n DOMAIN_NAME = 'your.url.here' # e.g. 'django-wm.dev'\n\n * Add \"mentions\" to :code:`INSTALLED_APPS`::\n\n INSTALLED_APPS = [\n 'django.contrib.auth',\n 'django.contrib.contenttypes',\n 'django.contrib.flatpages',\n 'django.contrib.sites',\n ...\n 'mentions',\n ]\n\n * Add :code:'mentions.middleware.WebmentionHeadMiddleware' to :code:`MIDDLEWARE`::\n\n MIDDLEWARE = [\n ...\n 'mentions.middleware.WebmentionHeadMiddleware',\n ]\n\n\n2. Root project :code:`urls.py` ::\n\n urlpatterns = [\n ...\n path('webmentions/, include('mentions.urls')),\n ]\n\n\n3. Include :code:`MentionableMixin` in the model(s) you want to support\n webmention functionality.\n\n IMPORTANT: Any models that include the mixin must also\n implement :code:`all_text` and :code:`get_absolute_url` methods::\n\n from mentions import MentionableMixin\n ...\n\n class MyModel(MentionableMixin, models.Model):\n ...\n def all_text(self) -> str:\n return f'{self.introduction} {self.content}'\n\n def get_absolute_url() -> str:\n return reverse('app.views.name', kwargs={'slug': self.slug})\n\n\n4. Update database tables::\n\n python manage.py makemigrations\n python manage.py migrate\n\n\n\n\nOptional Settings\n-----------------\n\nAdd these keys to your project :code:`settings.py` to alter default behaviour.\n\n :code:`WEBMENTIONS_AUTO_APPROVE` = :code:`bool` (default: :code:`False`)\n\n * :code:`True`: Received webmentions are automatically approved and may be publicly visible.\n * :code:`False`: Received webmentions require manual approval before they can be made public.\n\n\n", "description_content_type": "text/x-rst", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://beatonma.org/django-wm", "keywords": "", "license": "GPLv3", "maintainer": "", "maintainer_email": "", "name": "django-wm", "package_url": "https://pypi.org/project/django-wm/", "platform": "", "project_url": "https://pypi.org/project/django-wm/", "project_urls": { "Example implementation source": "https://github.com/beatonma/django-wm-example", "Homepage": "https://beatonma.org/django-wm", "Implementation tester": "https://django-wm.dev", "Source": "https://github.com/beatonma/django-wm" }, "release_url": "https://pypi.org/project/django-wm/1.0.2/", "requires_dist": [ "beautifulsoup4", "celery", "django", "mf2py", "requests" ], "requires_python": ">=3.6", "summary": "Webmention support for any Django model.", "version": "1.0.2" }, "last_serial": 5593778, "releases": { "1.0.1": [ { "comment_text": "", "digests": { "md5": "58831f80628d9aba4eaca9a31cf55c69", "sha256": "1f0a4e833efb7f7fd5720e3b68ee32f43fdec0ffeb1641094dc2e5fb2ec63530" }, "downloads": -1, "filename": "django_wm-1.0.1-py3-none-any.whl", "has_sig": false, "md5_digest": "58831f80628d9aba4eaca9a31cf55c69", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 40435, "upload_time": "2019-07-27T14:54:26", "url": "https://files.pythonhosted.org/packages/87/87/b35f6b9097e1b018ee20c1d34d1f34f7d96308500c236086feb04e2bcdd9/django_wm-1.0.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "7f0ff9ad54f8c97846259cf1ea157d7f", "sha256": "e65558b6b77a3ebc9665191434ca42687da7d21289210a86876120659639a5fa" }, "downloads": -1, "filename": "django-wm-1.0.1.tar.gz", "has_sig": false, "md5_digest": "7f0ff9ad54f8c97846259cf1ea157d7f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 30255, "upload_time": "2019-07-27T14:54:31", "url": "https://files.pythonhosted.org/packages/6f/9e/9abeb2192d0e03f7788b750e35c639e44f52bd71a229c073e689a70e8688/django-wm-1.0.1.tar.gz" } ], "1.0.2": [ { "comment_text": "", "digests": { "md5": "9fab6e61886cb6f2bfc7803459549a85", "sha256": "c15e00ec44aa3fe9cfc836a01d4bcfb05c9bb3e95c61576fef676a637f0aa999" }, "downloads": -1, "filename": "django_wm-1.0.2-py3-none-any.whl", "has_sig": false, "md5_digest": "9fab6e61886cb6f2bfc7803459549a85", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.6", "size": 40568, "upload_time": "2019-07-27T19:09:21", "url": "https://files.pythonhosted.org/packages/99/b6/eff4534aaa12b309c69cceb7acd370236a3a1ea8aeb37b8b5f0ab34bbcf2/django_wm-1.0.2-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "0302bdf982ff19fec773705946cb9125", "sha256": "04161cadea2a511d74ea072743c4f74bdbcd21859dea570914f2d2afb4337734" }, "downloads": -1, "filename": "django-wm-1.0.2.tar.gz", "has_sig": false, "md5_digest": "0302bdf982ff19fec773705946cb9125", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6", "size": 30595, "upload_time": "2019-07-27T19:09:25", "url": "https://files.pythonhosted.org/packages/b9/dd/a96bf37a609b5e50dad30b40fcf16a947aef3f4bb63b43a0b56feb0415ee/django-wm-1.0.2.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "9fab6e61886cb6f2bfc7803459549a85", "sha256": "c15e00ec44aa3fe9cfc836a01d4bcfb05c9bb3e95c61576fef676a637f0aa999" }, "downloads": -1, "filename": "django_wm-1.0.2-py3-none-any.whl", "has_sig": false, "md5_digest": "9fab6e61886cb6f2bfc7803459549a85", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.6", "size": 40568, "upload_time": "2019-07-27T19:09:21", "url": "https://files.pythonhosted.org/packages/99/b6/eff4534aaa12b309c69cceb7acd370236a3a1ea8aeb37b8b5f0ab34bbcf2/django_wm-1.0.2-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "0302bdf982ff19fec773705946cb9125", "sha256": "04161cadea2a511d74ea072743c4f74bdbcd21859dea570914f2d2afb4337734" }, "downloads": -1, "filename": "django-wm-1.0.2.tar.gz", "has_sig": false, "md5_digest": "0302bdf982ff19fec773705946cb9125", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6", "size": 30595, "upload_time": "2019-07-27T19:09:25", "url": "https://files.pythonhosted.org/packages/b9/dd/a96bf37a609b5e50dad30b40fcf16a947aef3f4bb63b43a0b56feb0415ee/django-wm-1.0.2.tar.gz" } ] }