{ "info": { "author": "Ferrix Hovi", "author_email": "ferrix@codetry.fi", "bugtrack_url": null, "classifiers": [ "Environment :: Web Environment", "Framework :: Django", "Framework :: Django :: 1.8", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python", "Topic :: Internet :: WWW/HTTP", "Topic :: Internet :: WWW/HTTP :: Dynamic Content" ], "description": "Namespace resolution context processor\n======================================\n\nDjango supports namespaces that help applications find out their current\nnamespace and refer to themselves in a stable way even if there are more\nthan one instance of the same module in the url patterns.\n\nHowever, Django does not automatically set the ``current_app`` context\nwhich means that the app will actually resolve the namespaced urls to\nthe last announced instance of itself.\n\nThis context processor digs the detail up and voil\u00e1.\n\nUsage\n-----\n\nThe context processor needs to be added to the template configuration. The\nrude way to do it is as follows::\n\n TEMPLATES[0]['OPTIONS']['context_processors'].append(\n 'namespaced.context_processors.namespaced')\n\nUsing a context processor for this use is a bit questionable and generally\na middleware would be the correct place to edit requests. However middlewares\nare executed at a stage where the URL resolution has not been matched and will\ntraverse all URLs even if they are not going to be used. This code is mostly\nrelevant in views anyway.\n\nThis enables you to have two separate instances of the same app in two\ndifferent urls. Normally Django would always refer to the last instance by the\napp name which will mess up all internal linkage within any of the previous\ninstances. Let's assume we have this inside an app::\n\n {% url 'myapp:index' %}\n\nTo make this work for both instances, the ``urls.py`` should look something\nlike this::\n\n urlpatterns = [\n url(r'^first/', include('myapp.urls', namespace='first', app_name='myapp')),\n url(r'^last/', include('myapp.urls', namespace='last', app_name='myapp)),\n ]\n\nThe apps can refer to themselves with `myapp:`, each other with `first:` and\n`last:`. It will most likely make sense to use the explicit names in the rest\nof the project.\n\nFor now, the use without namespaces has not been tested.", "description_content_type": null, "docs_url": null, "download_url": null, "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/codetry/django_namespaced/", "keywords": null, "license": "MIT License", "maintainer": null, "maintainer_email": null, "name": "django-namespaced", "package_url": "https://pypi.org/project/django-namespaced/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/django-namespaced/", "project_urls": { "Homepage": "https://github.com/codetry/django_namespaced/" }, "release_url": "https://pypi.org/project/django-namespaced/1.0.1/", "requires_dist": null, "requires_python": null, "summary": "Automagic url namespace resolution", "version": "1.0.1" }, "last_serial": 1582236, "releases": { "1.0.0": [ { "comment_text": "", "digests": { "md5": "4b989edbc143af0f1a826c31bd968375", "sha256": "82396a838c48ee53f2283815ac0897cb87289791b8fb8b19c8a0c3fe5dee710b" }, "downloads": -1, "filename": "django_namespaced-1.0.0-py2-none-any.whl", "has_sig": false, "md5_digest": "4b989edbc143af0f1a826c31bd968375", "packagetype": "bdist_wheel", "python_version": "py2", "requires_python": null, "size": 8540, "upload_time": "2015-06-07T16:07:26", "url": "https://files.pythonhosted.org/packages/c8/39/e028eda51d55156239c1674a15f4c3ef4066b9cd333c5fc89a15d3746bff/django_namespaced-1.0.0-py2-none-any.whl" }, { "comment_text": "", "digests": { "md5": "8c44d5963a0a73d5c79a4e4c68eac45a", "sha256": "7306185355f67b8c4eea7568806b1d02b1f5ebd4387c0a9367e044742c585784" }, "downloads": -1, "filename": "django_namespaced-1.0.0-py3-none-any.whl", "has_sig": false, "md5_digest": "8c44d5963a0a73d5c79a4e4c68eac45a", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 8538, "upload_time": "2015-06-07T16:07:30", "url": "https://files.pythonhosted.org/packages/83/82/958f76dd27b3143747a8c084b37133190f8c7c3c1e5afc2f5561e1040dee/django_namespaced-1.0.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "c743e6d2e3fd5d7583f8301edff05c45", "sha256": "159bebab98a0897531108bbe0d9d38bbdcb9febbf6d5cca70e16bd59d27a360a" }, "downloads": -1, "filename": "django-namespaced-1.0.0.tar.gz", "has_sig": false, "md5_digest": "c743e6d2e3fd5d7583f8301edff05c45", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 17903, "upload_time": "2015-06-07T16:07:22", "url": "https://files.pythonhosted.org/packages/5b/7c/46a6155bcc81721169bf6190203873dbaa5dfabb549165f0412d4f2c79af/django-namespaced-1.0.0.tar.gz" } ], "1.0.1": [ { "comment_text": "", "digests": { "md5": "dda0cd718966d615c527b9d23970073e", "sha256": "f89850286d911fff5f1edf9076451d873a77eca893173368fe0ccbd87dc1662b" }, "downloads": -1, "filename": "django_namespaced-1.0.1-py2-none-any.whl", "has_sig": false, "md5_digest": "dda0cd718966d615c527b9d23970073e", "packagetype": "bdist_wheel", "python_version": "py2", "requires_python": null, "size": 9255, "upload_time": "2015-06-07T19:20:12", "url": "https://files.pythonhosted.org/packages/fd/f7/1b691e883025441f10881771b27a7d4dd4d5037399e2d5bb1f79627b2d09/django_namespaced-1.0.1-py2-none-any.whl" }, { "comment_text": "", "digests": { "md5": "7fecd1a73b5dfceac5209f5f997057d1", "sha256": "6505100b1ed62d55d140d811b7f7545b5c4dc7061525d60832d6404a6a41db81" }, "downloads": -1, "filename": "django_namespaced-1.0.1-py3-none-any.whl", "has_sig": false, "md5_digest": "7fecd1a73b5dfceac5209f5f997057d1", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 9249, "upload_time": "2015-06-07T19:20:16", "url": "https://files.pythonhosted.org/packages/02/d3/e6765d643911137626f83d0e1bbc62b94b94295cea04f544871ce7509acc/django_namespaced-1.0.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "1434bf7af398eac892405bf0c19e561a", "sha256": "c9dc3e035fead5bd97fb251f4a6f7c812abeff14d58b31cc202db8772848d611" }, "downloads": -1, "filename": "django-namespaced-1.0.1.tar.gz", "has_sig": false, "md5_digest": "1434bf7af398eac892405bf0c19e561a", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 18269, "upload_time": "2015-06-07T19:20:08", "url": "https://files.pythonhosted.org/packages/c2/7b/899544cd8aea99791a60bcaeaa00159b9a04185454d3a09a22de2577dd50/django-namespaced-1.0.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "dda0cd718966d615c527b9d23970073e", "sha256": "f89850286d911fff5f1edf9076451d873a77eca893173368fe0ccbd87dc1662b" }, "downloads": -1, "filename": "django_namespaced-1.0.1-py2-none-any.whl", "has_sig": false, "md5_digest": "dda0cd718966d615c527b9d23970073e", "packagetype": "bdist_wheel", "python_version": "py2", "requires_python": null, "size": 9255, "upload_time": "2015-06-07T19:20:12", "url": "https://files.pythonhosted.org/packages/fd/f7/1b691e883025441f10881771b27a7d4dd4d5037399e2d5bb1f79627b2d09/django_namespaced-1.0.1-py2-none-any.whl" }, { "comment_text": "", "digests": { "md5": "7fecd1a73b5dfceac5209f5f997057d1", "sha256": "6505100b1ed62d55d140d811b7f7545b5c4dc7061525d60832d6404a6a41db81" }, "downloads": -1, "filename": "django_namespaced-1.0.1-py3-none-any.whl", "has_sig": false, "md5_digest": "7fecd1a73b5dfceac5209f5f997057d1", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 9249, "upload_time": "2015-06-07T19:20:16", "url": "https://files.pythonhosted.org/packages/02/d3/e6765d643911137626f83d0e1bbc62b94b94295cea04f544871ce7509acc/django_namespaced-1.0.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "1434bf7af398eac892405bf0c19e561a", "sha256": "c9dc3e035fead5bd97fb251f4a6f7c812abeff14d58b31cc202db8772848d611" }, "downloads": -1, "filename": "django-namespaced-1.0.1.tar.gz", "has_sig": false, "md5_digest": "1434bf7af398eac892405bf0c19e561a", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 18269, "upload_time": "2015-06-07T19:20:08", "url": "https://files.pythonhosted.org/packages/c2/7b/899544cd8aea99791a60bcaeaa00159b9a04185454d3a09a22de2577dd50/django-namespaced-1.0.1.tar.gz" } ] }