{ "info": { "author": "Sebastian Vetter", "author_email": "sebastian.vetter@tangentone.com.au", "bugtrack_url": null, "classifiers": [ "Development Status :: 3 - Alpha", "Environment :: Web Environment", "Framework :: Django", "Intended Audience :: Developers", "License :: OSI Approved :: Apache Software License", "License :: OSI Approved :: BSD License", "Operating System :: OS Independent", "Programming Language :: Python", "Topic :: Software Development" ], "description": "django-url-tracker\n==================\n\n.. image:: https://travis-ci.org/elbaschid/django-url-tracker.png\n :target: https://travis-ci.org/elbaschid/django-url-tracker\n\nThe ``django-url-tracker`` is meant to be a easy-to-use addition to\na website to enhance its SEO. This might seem slightly pointless\nas `Cool URIs don't change\n`_. I don't want to argue\nwith that and not changing URL should be the primary goal. In case,\na URL is changed for some reason, however, this can reflect badly in\nterms of SEO as search engines do not appreciate ending up on a 404\npage when crawling a known URL. To handle these situations nicely\n``django-url-tracker`` keeps track of URL changes and when the *old*\nURL is called provides a permanent redirect (HTTP 301) or a gone\nresponse (HTTP 410) for deleted URLs.\n\nThe tracking is aimed at those URLs that are generated based on\nmodel fields, e.g. a *slug* field. To start tracking URL changes\nfor a particular model, you simply have to register the model\nwith ``url_tracker`` and everytime a model is changed or deleted,\nURL changes are recorded.\n\nThe HTTP repsonses that provide an ``HttpResponsePremanentRedirect``\nor ``HttpResponseGone`` are handled similar to the ``flatpages``\nmiddleware, intercepting ``404`` exceptions and checking for the\nrequested URLs in all existing ``URLChangeRecords``. Depending\non the recorded data the corresponding HTTP response is return or\na ``404`` is raised when no URL matching the requested one can be\nfound.\n\nInstallation\n------------\n\nInstallation is as easy as::\n\n pip install django-url-tracker\n\nDone!\n\nConfiguration\n-------------\n\nTo start using ``url_tracker`` in your project. Just add the\nfollowing two lines to your ``settings.py``:\n\n1. Add the middleware ``url_tracker.middleware.URLChangePermanentRedirectMiddleware``\n to the end of ``MIDDLEWARE_CLASSES`` which should look similar\n to this afterwards::\n\n MIDDLEWARE_CLASSES = (\n 'django.middleware.common.CommonMiddleware',\n 'django.contrib.sessions.middleware.SessionMiddleware',\n 'django.middleware.csrf.CsrfViewMiddleware',\n 'django.contrib.auth.middleware.AuthenticationMiddleware',\n 'django.contrib.messages.middleware.MessageMiddleware',\n 'django.contrib.flatpages.middleware.FlatpageFallbackMiddleware',\n 'url_tracker.middleware.URLChangePermanentRedirectMiddleware',\n )\n\n2. Add ``url_tracker`` to your ``INSTALLED_APPS`` ::\n\n INSTALLED_APPS = (\n \"url_tracker\",\n )\n\n\n\nNow you are able to use ``url_tracker`` within you project. All that\nremains to do is registering a model for tracking.\n\nTracking A Model\n----------------\n\nThis is just a simple example of how to track a model. Let's assume we\nhave a model ``Project`` that hold details on this particular project and\nis made available at the URL ``http://www.example.com/project/some-project/``.\nThe project's URL is based on the ``SlugField`` of our model. The model could\nlook like this::\n\n class Project(models.Model):\n name = models.CharField(max_length=20)\n slug = models.SlugField(max_length=20)\n description = models.CharField(max_length=500)\n\n\nI will not go into details of how to create the slug as I think this is\ncommon practise. So for now we just assume that ``slug`` is populated\nautomatically from ``name``. One other thing, however, is required for\nthe tracker to work, the ``get_absolute_url`` method. Let's add this to\nthe model::\n\n class Project(models.Model):\n ...\n\n @models.permalink\n def get_absolute_url(self):\n return ('project-detail', (), {'slug': self.slug})\n\nAnd now the missing link to actually start tracking URL changes is adding\nthe following command to the bottom of the class definition, or the file\nfor that matter::\n\n import url_tracker\n url_tracker.track_url_changes_for_model(Project)\n\nYou are done. If you go to the admin interface, create a new project\nand then change its slug (which changes its URL) you will see a new\n``URLChangeRecord`` reflecting the change. Opening the ``old_url`` should\nthen redirect you to the ``new_url``.\n\nContributing\n------------\n\nIf you find issues or would like to see a feature suppored, head over to\nthe `issues section:\n`_ and report it.\n\nTo contribute code in any form, fork the `github repository:\n`_ and clone it locally.\nCreate a new branch for your feature::\n\n git commit -b feature/whatever-you-like\n\npush the finished feature to github and open a pull request form the branch.", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/tangentlabs/django-url-tracker", "keywords": "seo,django,framework", "license": "BSD", "maintainer": null, "maintainer_email": null, "name": "django-url-tracker", "package_url": "https://pypi.org/project/django-url-tracker/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/django-url-tracker/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/tangentlabs/django-url-tracker" }, "release_url": "https://pypi.org/project/django-url-tracker/0.1.3/", "requires_dist": null, "requires_python": null, "summary": "A little app that trackes URL changes in a database table to provide HTTP 301 & 410 on request.", "version": "0.1.3" }, "last_serial": 705731, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "66f37c7172aaaa69bde9150cf5f1fbf0", "sha256": "8d92bc6bbfb44b91944a40b06e362527b16c60982d3336a8825ae7e6b5ae3249" }, "downloads": -1, "filename": "django-url-tracker-0.1.0.tar.gz", "has_sig": false, "md5_digest": "66f37c7172aaaa69bde9150cf5f1fbf0", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 10316, "upload_time": "2012-05-09T07:38:52", "url": "https://files.pythonhosted.org/packages/59/24/fb04bb5d70c07a052442014654c50893c9258f4fe6a492d45ff7c682dcc0/django-url-tracker-0.1.0.tar.gz" } ], "0.1.1": [ { "comment_text": "", "digests": { "md5": "825b812edfa3cf2028b5e6dffbcded21", "sha256": "7cae6d965fdb7a77c1f5f4e4fb00f4ca320b137a43ca0d91092be6ffee23f3ca" }, "downloads": -1, "filename": "django-url-tracker-0.1.1.tar.gz", "has_sig": false, "md5_digest": "825b812edfa3cf2028b5e6dffbcded21", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 14293, "upload_time": "2012-05-09T08:51:52", "url": "https://files.pythonhosted.org/packages/15/02/f4e8833f6c7c50ec2a68f4aa3a306a59eb67e95d56aa0e9309f35176439c/django-url-tracker-0.1.1.tar.gz" } ], "0.1.2": [ { "comment_text": "", "digests": { "md5": "88dab42df9f95c9755905c11a03c060a", "sha256": "761bf98ebdc929fe58388bf92d160ec299bea89c91a16c073fff2a3f0a51c50e" }, "downloads": -1, "filename": "django-url-tracker-0.1.2.tar.gz", "has_sig": false, "md5_digest": "88dab42df9f95c9755905c11a03c060a", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 14682, "upload_time": "2012-09-07T05:10:26", "url": "https://files.pythonhosted.org/packages/a0/f7/71d15bfd9ce967edbb7572ea1f3786529cf74d12417bc9b18a5c23903268/django-url-tracker-0.1.2.tar.gz" } ], "0.1.3": [ { "comment_text": "", "digests": { "md5": "792d04f0514fd493e8e07684ef63f4e2", "sha256": "46cad65ae1f6f97877cb3b0f21965f147e75367aa3ccacd0fd76487e9532a644" }, "downloads": -1, "filename": "django-url-tracker-0.1.3.tar.gz", "has_sig": false, "md5_digest": "792d04f0514fd493e8e07684ef63f4e2", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 15032, "upload_time": "2013-01-29T11:20:44", "url": "https://files.pythonhosted.org/packages/4c/36/c070f377025eb6dcf126f6713586a5167c5f06e04896c54a4ff181b2f331/django-url-tracker-0.1.3.tar.gz" } ], "versiontools-url-tracker-": [ { "comment_text": "", "digests": { "md5": "6269cb1803bc5f38ae4bd4b45afea37e", "sha256": "b8634c171eb841f32a4452032de3c324c5d685fbda7479c115e7534653e25b66" }, "downloads": -1, "filename": "django-url-tracker-versiontools-url-tracker-.tar.gz", "has_sig": false, "md5_digest": "6269cb1803bc5f38ae4bd4b45afea37e", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 14889, "upload_time": "2012-09-07T05:05:43", "url": "https://files.pythonhosted.org/packages/40/ba/740d50c81f053d91f10d2566c485135904b20f3f9b0af034f1bb9e2e8809/django-url-tracker-versiontools-url-tracker-.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "792d04f0514fd493e8e07684ef63f4e2", "sha256": "46cad65ae1f6f97877cb3b0f21965f147e75367aa3ccacd0fd76487e9532a644" }, "downloads": -1, "filename": "django-url-tracker-0.1.3.tar.gz", "has_sig": false, "md5_digest": "792d04f0514fd493e8e07684ef63f4e2", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 15032, "upload_time": "2013-01-29T11:20:44", "url": "https://files.pythonhosted.org/packages/4c/36/c070f377025eb6dcf126f6713586a5167c5f06e04896c54a4ff181b2f331/django-url-tracker-0.1.3.tar.gz" } ] }