{ "info": { "author": "(the author)", "author_email": "mdilligaf@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 5 - Production/Stable", "Intended Audience :: Developers", "License :: OSI Approved :: BSD License", "Natural Language :: English", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: Implementation :: PyPy", "Topic :: Software Development :: Libraries :: Python Modules" ], "description": "\nDjango hreflang\n---------------------------------\n\nProviding hreflang information for your website is recommended by Google. If you are using i18n urls, this Django app can add this hreflang information automatically in one of several ways.\n\nFor more information about hreflang, have a look at https://support.google.com/webmasters/answer/189077?hl=en\n\nInstallation & Configuration:\n-----------------------------\n\nThis assumes that you are using internationalization for your URL patterns, as described at https://docs.djangoproject.com/en/1.7/topics/i18n/translation/#module-django.conf.urls.i18n\n\nFirst install the package::\n\n pip install django_hreflang\n\nUse version django_hreflang==1.7 for django version inferior to 2.0.\n\nYou may need to take *zero or one* of these steps:\n\n- If you want to use the html tag, add ``hreflang`` to your ``INSTALLED_APPS``\n- If you want to use the middleware, add ``hreflang.AddHreflangToResponse`` to your ``MIDDLEWARE_CLASSES``\n\nIf you have other middleware that changes the Files header, that should be okay if it doesn't overwrite previous headers. You may want to add hreflang as the first middleware when in doubt.\n\nHow to use\n---------------------------------\n\nhreflang information can, in general, be provided in three ways: in the html files's , in the http Files header or through a sitemap. This package supports the first two.\n\nWhich way should I use?\n=================================\n\nMy personal preference is using the HTML links in a special block in the base template. If there are any special documents (e.g. pdf) use the ``hreflang_headers`` function. This allows per-page control with minimal effort (unless you serve mostly special documents).\n\nHTML (template tags)\n=================================\n\nTo include the links in the , follow this minimal example::\n\n {% load hreflang %}\n \n {% hreflang_tags %}\n \n\n(hreflang must be in installed apps.)\n\nResponse header (manually)\n=================================\n\nThe template tag method works great for normal files. But if you have special files (e.g. pdf) with multiple versions, you can use the response's file header by::\n\n from hreflang import hreflang_headers\n def your_view(request):\n response = your_code()\n return hreflang_headers(response)\n\nwhich will take care of things.\n\nResponse header (middleware)\n=================================\n\nA more automatic way that captures all kinds of files is to use a middleware. All you have to do is add ``hreflang.AddHreflangToResponse`` to your ``MIDDLEWARE_CLASSES``. You don't need to use ``hreflang_headers`` or ``{% hreflang_tags %}``. This will apply to all responses, it can not be turned on or off for individual responses.\n\n\nUseful extra template tags\n=================================\n\nFor convenience, some more template tags are included.\n\nTo obtain a link to the current document in another language, use::\n\n {% translate_url 'en' %}\n\nTo obtain a link to a specified view, use::\n\n {% translate_url 'en' view_name='namespace:name' %}\n\nTo get a list of
  • -links to all (other) language versions of the current document, use one of::\n\n \n \n\nUseful extra function(s)\n=================================\n\nhreflang contains a version of ``reverse`` with additional parameters ``lang`` and ``use_lang_prefix``.\n\n* With both parameters left out it behaves just like Django's ``reverse`` (which translates the url to the current language)\n* With ``lang`` you can provide a specific language (by code) into which the url is to be translated.\n* By setting ``use_lang_prefix`` to False, you can obtain an url without language prefix.\n\nLicense\n---------------------------------\n\ndjango_hreflang is available under the revised BSD license, see LICENSE.txt. You can do anything as long as you include the license, don't use my name for promotion and are aware that there is no warranty.\n\nContributions\n---------------------------------\n\nAny improvements through pull requests are welcome! You can also open an issue if you notice a problem.\n\nNotable contributors:\n\n* @mverleg (owner)\n* @hellishnoob (pull request #1)\n* @pierre-sassoulas (django2.0, pr #2)\n* @syastrov (default prefix fix, pr #3)\n\n", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://bitbucket.org/mverleg/django_hreflang", "keywords": "django", "license": "Revised BSD License (LICENSE.txt)", "maintainer": "", "maintainer_email": "", "name": "django_hreflang", "package_url": "https://pypi.org/project/django_hreflang/", "platform": "", "project_url": "https://pypi.org/project/django_hreflang/", "project_urls": { "Homepage": "https://bitbucket.org/mverleg/django_hreflang" }, "release_url": "https://pypi.org/project/django_hreflang/2.2/", "requires_dist": null, "requires_python": "", "summary": "Generate the hreflang html header lines when using i18n urls on Django sites", "version": "2.2" }, "last_serial": 3877343, "releases": { "1.0.0": [ { "comment_text": "", "digests": { "md5": "e6b981682fc5f3ba0926c202ffee361f", "sha256": "9b767bf84db168fcdb7f0450b8d96f081ed00184ea38d7b35f49631bbf61ab16" }, "downloads": -1, "filename": "django_hreflang-1.0.0.tar.gz", "has_sig": false, "md5_digest": "e6b981682fc5f3ba0926c202ffee361f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5963, "upload_time": "2015-08-06T17:04:32", "url": "https://files.pythonhosted.org/packages/70/1a/a32cbaae3573544ad3bae5c57603d900aa9967e41a9750b454cfb6f5a957/django_hreflang-1.0.0.tar.gz" } ], "1.1": [ { "comment_text": "", "digests": { "md5": "1466f2891c71571518e8556ebff87fb7", "sha256": "d058c79066805ff48185d636b940303fa298d7c6b059457cf692cef4e2881a1c" }, "downloads": -1, "filename": "django_hreflang-1.1.tar.gz", "has_sig": false, "md5_digest": "1466f2891c71571518e8556ebff87fb7", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5977, "upload_time": "2015-08-06T18:00:32", "url": "https://files.pythonhosted.org/packages/d4/37/6101d8305cf74df7f8cb0010d0071d73d85d644fddea6326015b943495b6/django_hreflang-1.1.tar.gz" } ], "1.2": [ { "comment_text": "", "digests": { "md5": "9410b25179847e8a4b8694627fd17b38", "sha256": "179f23a952923ca9862b8b067ed9fa6ffc48d48e218d704f5dd2a0751b70dd4b" }, "downloads": -1, "filename": "django_hreflang-1.2.tar.gz", "has_sig": false, "md5_digest": "9410b25179847e8a4b8694627fd17b38", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5948, "upload_time": "2015-08-06T18:06:10", "url": "https://files.pythonhosted.org/packages/1b/df/0af80591c71e8643af0bb445389dec8a435c852ee18474349614074ab6e1/django_hreflang-1.2.tar.gz" } ], "1.3": [ { "comment_text": "", "digests": { "md5": "b97bd0753eb2808ceaa3d254e9e2f91c", "sha256": "e569f0f2018548b26ec296534db0d7118ed72cc0a10e2bfd372852a3c60c8e59" }, "downloads": -1, "filename": "django_hreflang-1.3.tar.gz", "has_sig": false, "md5_digest": "b97bd0753eb2808ceaa3d254e9e2f91c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5903, "upload_time": "2015-10-14T00:18:44", "url": "https://files.pythonhosted.org/packages/39/52/71d6e8ec4d29b05af0c7f88d86295c47f97aba05ad981bc27be0a0d4ef60/django_hreflang-1.3.tar.gz" } ], "1.7": [ { "comment_text": "", "digests": { "md5": "0af03f108348332e82db141c1d8312b5", "sha256": "376d45a9f82a73b733b8c38eb34960ced090068feb3d89f63f7653dcfd97692b" }, "downloads": -1, "filename": "django_hreflang-1.7-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "0af03f108348332e82db141c1d8312b5", "packagetype": "bdist_wheel", "python_version": "2.7", "requires_python": null, "size": 9319, "upload_time": "2016-11-25T12:53:27", "url": "https://files.pythonhosted.org/packages/5d/a4/e34198ec79610c8260beed3ff12a173b48da7cd351714573d0ea7014af09/django_hreflang-1.7-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "d37cdedb19a09da59f24c0a81dfe2f43", "sha256": "2a29384ce172714d559212d497e72ade6be596b76ad879a6174225ac25356ca1" }, "downloads": -1, "filename": "django_hreflang-1.7.tar.gz", "has_sig": false, "md5_digest": "d37cdedb19a09da59f24c0a81dfe2f43", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6562, "upload_time": "2016-11-25T12:53:24", "url": "https://files.pythonhosted.org/packages/ba/33/c1e4532968161b7b306b6dab54ed9ebbff4770a3c7f65f3d6772b4f973b1/django_hreflang-1.7.tar.gz" } ], "2.0": [ { "comment_text": "", "digests": { "md5": "b88122401aa1e4de1e26843f93de1954", "sha256": "4718f17f56aa56dd7a58613f91cb32dafe9f7437c254e5656e2acec4702570f7" }, "downloads": -1, "filename": "django_hreflang-2.0.tar.gz", "has_sig": false, "md5_digest": "b88122401aa1e4de1e26843f93de1954", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6815, "upload_time": "2018-03-27T11:51:00", "url": "https://files.pythonhosted.org/packages/a9/0d/dda0164a6bd7118ce0fc53a393e607275a4fb5bf88b706764258287ac102/django_hreflang-2.0.tar.gz" } ], "2.1": [ { "comment_text": "", "digests": { "md5": "435201162b468919f291ab83e5b54ebd", "sha256": "1195edde05c45e88b60ef641de37a128f98fe7ddf50f78c9f4d16b4570d14aa3" }, "downloads": -1, "filename": "django_hreflang-2.1.tar.gz", "has_sig": false, "md5_digest": "435201162b468919f291ab83e5b54ebd", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6858, "upload_time": "2018-04-13T19:13:20", "url": "https://files.pythonhosted.org/packages/55/0d/d2ec600e8e6095e13e8e58527476954b6de1104faed047a6cbc485a65ab8/django_hreflang-2.1.tar.gz" } ], "2.2": [ { "comment_text": "", "digests": { "md5": "9b4d26140697fb9fa79afddd8dae25d0", "sha256": "e5e86252443a634cfab7e72dbfdb3d166737f62560cf4b5d42d091bbfa8157f9" }, "downloads": -1, "filename": "django_hreflang-2.2.tar.gz", "has_sig": false, "md5_digest": "9b4d26140697fb9fa79afddd8dae25d0", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6847, "upload_time": "2018-05-18T19:26:32", "url": "https://files.pythonhosted.org/packages/1f/c9/fe1cbeb2fbd880c063a851b0eda4da2af5b160e3553ea776e56ee9b6e0f0/django_hreflang-2.2.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "9b4d26140697fb9fa79afddd8dae25d0", "sha256": "e5e86252443a634cfab7e72dbfdb3d166737f62560cf4b5d42d091bbfa8157f9" }, "downloads": -1, "filename": "django_hreflang-2.2.tar.gz", "has_sig": false, "md5_digest": "9b4d26140697fb9fa79afddd8dae25d0", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6847, "upload_time": "2018-05-18T19:26:32", "url": "https://files.pythonhosted.org/packages/1f/c9/fe1cbeb2fbd880c063a851b0eda4da2af5b160e3553ea776e56ee9b6e0f0/django_hreflang-2.2.tar.gz" } ] }