{"id":13813714,"url":"https://github.com/isms/django-hide-herokuapp","last_synced_at":"2025-05-15T00:34:02.688Z","repository":{"id":28443174,"uuid":"31958441","full_name":"isms/django-hide-herokuapp","owner":"isms","description":"Django app for Heroku users designed to hide your .herokuapp.com site from search engine results.","archived":true,"fork":false,"pushed_at":"2016-05-09T16:15:59.000Z","size":11,"stargazers_count":6,"open_issues_count":2,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-11-02T07:08:06.570Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/isms.png","metadata":{"files":{"readme":"README.rst","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-03-10T13:18:17.000Z","updated_at":"2023-04-10T17:54:54.000Z","dependencies_parsed_at":"2022-07-25T17:52:39.585Z","dependency_job_id":null,"html_url":"https://github.com/isms/django-hide-herokuapp","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/isms%2Fdjango-hide-herokuapp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/isms%2Fdjango-hide-herokuapp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/isms%2Fdjango-hide-herokuapp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/isms%2Fdjango-hide-herokuapp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/isms","download_url":"https://codeload.github.com/isms/django-hide-herokuapp/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225319317,"owners_count":17455747,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-04T04:01:26.983Z","updated_at":"2024-11-19T08:30:55.734Z","avatar_url":"https://github.com/isms.png","language":"Python","funding_links":[],"categories":["Python"],"sub_categories":[],"readme":"django-hide-herokuapp\n=====================\n\nDjango app for Heroku users designed to hide your ``*.herokuapp.com``\nfrom search engine results.\n\n.. image:: https://img.shields.io/pypi/v/django-hide-herokuapp.svg\n    :target: https://pypi.python.org/pypi/django-hide-herokuapp\n\nUse case\n--------\n\nYou want to develop a website called ``artisanalraisinbeer.com`` using\nDjango deployed on Heroku. You write a little bit of Django code and\ncreate a new Heroku app called ``artisanalraisinbeer`` to deploy to.\n\nWhile developing, you can visit your site by going to this URL:\n``http://artisanalraisinbeer.herokuapp.com``\n\nEventually, you finish the first version of your website, buy the\ndomain name `artisanalraisinbeer.com`, and set everything up\nso that you can view the site just by going to the following URL:\n``http://www.artisanalraisinbeer.com``\n\nYou can still visit ``http://artisanalraisinbeer.herokuapp.com``, which\nis fine—but there's one problem: you want your main site to show\nup in search results, *not* your ``.herokuapp.com`` site.\n\nHow it works\n------------\n\nThis app goes about this two ways: `robots.txt \u003chttp://www.robotstxt.org/robotstxt.html\u003e`_\nand the `X-Robots-Tag \u003chttps://developers.google.com/webmasters/control-crawl-index/docs/robots_meta_tag\u003e`_.\nWhy both? *To be double-plus sure...* :eyes:\n\nIf ``herokuapp`` seems to be in the `originating host`_\nof the user request, then we do two things:\n\n* Put the following in ``robots.txt``::\n\n      User-agent: *\n      Disallow: /\n    \n* Set ``X-Robots-Tag`` in our response header to ``noindex, nofollow``.\n\nFor search engines that respect these settings, they should start to ignore these sites\nin future crawls.\n\nQuick start\n-----------\n\n1. Add ``'hide_herokuapp'`` to your ``INSTALLED_APPS`` setting.\n\n2. Add the ``HideHerokuappFromRobotsMiddleware`` middleware to your ``MIDDLEWARE_CLASSES``\n   like this::\n   \n     MIDDLEWARE_CLASSES = (\n         ...\n         'hide_herokuapp.middleware.HideHerokuappFromRobotsMiddleware',\n     )\n   \n\n3. Include the ``hide_herokuapp`` URLs in your project's ``urls.py`` like this::\n   \n\n      urlpatterns = [\n         ...\n         url(r'^', include('hide_herokuapp.urls')),\n         ...\n      ]\n   \n   alternatively, you may hook up the view directly::\n\n      from hide_herokuapp.views import herokuapp_robots_view\n\n      urlpatterns = [\n        ...\n        url(r'^robots\\.txt$', herokuapp_robots_view),\n        ...\n      ] \n\nContribute\n----------\n\nPyPI (Downloads)\n    https://pypi.python.org/pypi/django-hide-herokuapp\nOfficial repository\n    https://github.com/isms/django-hide-herokuapp\nIssue tracker\n    https://github.com/isms/django-hide-herokuapp/issues\n\n.. _originating host: https://docs.djangoproject.com/en/1.9/ref/request-response/#django.http.HttpRequest.get_host\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fisms%2Fdjango-hide-herokuapp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fisms%2Fdjango-hide-herokuapp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fisms%2Fdjango-hide-herokuapp/lists"}