{ "info": { "author": "Jeff Tchang", "author_email": "jeff.tchang@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Environment :: Web Environment", "Framework :: Django", "Intended Audience :: Developers", "License :: OSI Approved :: BSD License", "Operating System :: OS Independent", "Programming Language :: Python", "Topic :: Utilities" ], "description": "This Django application allows you to create urls that directly return views.\nThere is no 302 Redirect.\n\nThe most common use case is that you have URLs which return user profiles such as\n\nhttp://www.example.com/user/1\n\nFriendly URLs allow you to create a URL so that the user can also be accessed by going to:\n\nhttp://www.example.com/jeff\n\nThe key is that the address bar in the browser does not change to http://www.example.com/user/1\nThe web server returns the same HTML document as http://www.example.com/user/1\n\nFlow\n-----\n\nThe application looks up the string 'jeff' If it finds a friendly url match it will read out the absolute_path\nand attempt to resolve it by putting it through the URL resolver a 2nd time.\n\nIf it finds a resolution it will return that view.\n\n\nUsage\n-----\n\nHere is an example of how to implement friendly_urls for a user:\n\nI put this in models.py:\n\nfrom django.contrib.contenttypes import generic\nfrom friendlyurls import UrlMapping\nfrom django.contrib.auth.models import User\n\ndef get_absolute_url(self):\n return u'/user/%s' % self.id\n\nUser.add_to_class('friendly_urls', generic.GenericRelation(UrlMapping))\nUser.get_absolute_url = get_absolute_url\n\nThis basically monkey patches the User model to add a field. You can then do\n\nuser = User.objects.get(pk=1)\nuser.friendly_urls.all()\n\nThis will get a list of all the friendly urls.\n\nYou shouldn't have to monkey patch all the models.\n\nProblems / Questions\n--------------------\n\nDon't forget to run syncdb because friendlyurls creates a table to store the URL mappings.\n\n\nAdditional Settings\n-------------------\n\nFRIENDLYURLS_IGNORE_CASE - Set this to True if you want to ignore the case when trying to find a path. Default: False\n\nTodo Features\n-------------\n\n- Need to cache the results returned by a lookup for performance.\nProbably do a from django.core.cache import cache\n\nhttps://docs.djangoproject.com/en/dev/topics/cache/?from=olddocs", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "http://github.com/tachang/django_friendlyurls/", "keywords": null, "license": "UNKNOWN", "maintainer": null, "maintainer_email": null, "name": "django_friendlyurls", "package_url": "https://pypi.org/project/django_friendlyurls/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/django_friendlyurls/", "project_urls": { "Download": "UNKNOWN", "Homepage": "http://github.com/tachang/django_friendlyurls/" }, "release_url": "https://pypi.org/project/django_friendlyurls/0.1.1/", "requires_dist": null, "requires_python": null, "summary": "Use friendly urls with Django.", "version": "0.1.1" }, "last_serial": 791103, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "13c9451a147d4b266be2629f40346e09", "sha256": "674db61ffc05bd2dd65af52fc65d9fdb173c59c5f5cff6ce541c10b0b4493f87" }, "downloads": -1, "filename": "django_friendlyurls-0.1.0.tar.gz", "has_sig": false, "md5_digest": "13c9451a147d4b266be2629f40346e09", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3538, "upload_time": "2012-03-24T23:03:11", "url": "https://files.pythonhosted.org/packages/02/e1/d5a1301153f790fe4348535fc599331d281614f80095ecca70eca9e7d5ba/django_friendlyurls-0.1.0.tar.gz" } ], "0.1.1": [ { "comment_text": "", "digests": { "md5": "15417c42b71436a09261eaea9e61feb8", "sha256": "387c506b7a0ec4aa16b9088158b4b513cda95f67438bd08112aadc98c04dfff8" }, "downloads": -1, "filename": "django_friendlyurls-0.1.1.tar.gz", "has_sig": false, "md5_digest": "15417c42b71436a09261eaea9e61feb8", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4714, "upload_time": "2012-03-24T23:07:16", "url": "https://files.pythonhosted.org/packages/91/13/69d85892b2a6c8f5a09a338b88b1da451a4fe949d8d664dba6956a5d2339/django_friendlyurls-0.1.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "15417c42b71436a09261eaea9e61feb8", "sha256": "387c506b7a0ec4aa16b9088158b4b513cda95f67438bd08112aadc98c04dfff8" }, "downloads": -1, "filename": "django_friendlyurls-0.1.1.tar.gz", "has_sig": false, "md5_digest": "15417c42b71436a09261eaea9e61feb8", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4714, "upload_time": "2012-03-24T23:07:16", "url": "https://files.pythonhosted.org/packages/91/13/69d85892b2a6c8f5a09a338b88b1da451a4fe949d8d664dba6956a5d2339/django_friendlyurls-0.1.1.tar.gz" } ] }