{ "info": { "author": "Level 12", "author_email": "devteam@level12.io", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Intended Audience :: Developers", "License :: OSI Approved :: BSD License", "Operating System :: OS Independent", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5" ], "description": ".. default-role:: code\n.. role:: python(code)\n :language: python\n\n==========\nKegLogin\n==========\n\n.. image:: https://circleci.com/gh/level12/keg-login.svg?style=svg\n :target: https://circleci.com/gh/level12/keg-login\n\n.. image:: https://codecov.io/github/level12/keg-login/coverage.svg?branch=master\n :target: https://codecov.io/github/level12/keg-login?branch=master\n\n.. _Keg: https://pypi.python.org/pypi/Keg\n\nBase views and forms for user login and password management in Keg_ applications.\n\nUsage\n*****\n\nThere are 5 base views to allow users to login, logout and set their passwords.\n\n* Login\n* Logout\n* ChangePassword\n* ForgotPassword\n* ResetPassword\n\nTo make use of these views in your application, subclass the appropriate view\nand it's contained `Responder` class and implement the pure virtual methods.\n\nYou may override the templates used for these views by creating the\nappropriately named template under `/templates/keg-login/` or\noverriding `template` in your `Responder` subclass\n\nExample\n=======\n\n.. code:: python\n\n from keg import Keg\n from keg_login.ext import KegLogin\n from keg_login import views\n\n app = Keg(__name__)\n KegLogin(app)\n\n class ForgotPassword(views.ForgotPassword):\n class Responder(views.ForgotPassword.Responder):\n def request_password_reset(self, email):\n generate_token_and_send_email(email)\n\nTemplates\n=========\n\nKeg-Login makes great use of a great Jinja2 feature called macros. they allows the\nuser of Keg-Login to override just the piece of functionality or design without\na lot of work. Here is how:\n\nAfter install Keg-Login, create a ``keg-login`` folder in your application\ntemplate folder.\n\n\nUse own template\n----------------\n\nIn this folder create a file called `base.html`\n\nWithin `base.html` build or ``extend`` the template you want to surround the\nlogin views. The only thing that Keg-Login expects is for `base.html` to expose\na ``block main`` somewhere in that file. For example...\n\n.. code::\n\n {% extends your-master-template.html %}\n\n {# This block might be defined in your-master-template.html #}\n {% block content %}\n {% block main %}{% endblock %}\n {% endblock %}\n\n\nNow Keg-Login will use the master template as the base for the auth views.\n\n\nOverride Keg-Login Form Rendering (Using the Macro System)\n----------------------------------------------------------\n\nCreate the `macros.html` file in `app/templates/keg-login/macros.html`. At first\nall we need to do is add ::\n\n {% extends \"keg-login/_macros.html\" %}\n\nThe `_macros.html` file defines all the base/default macros for rendering the\nview templates. Everything in Keg-Login is a macro.\n\nA common macro to override is the ``render_wrapper`` macro. ``render_wrapper``\nand advanced feature of Jinja2 to allow the forms in Keg-Login to be \"wrapped\"\nwith additional HTML. For example, if you have a bunch of extra code you want to\nsurround the form elements with. This requires a little more explanation...\n\n\nSay for example you have this `master` template...\n\n.. code:: jinja2\n\n \n
\n {% block container %} {% endblock %}\n
\n \n\nYou then extend this in `keg-login/base.html` like so...\n\n.. code:: html\n\n {% extends \"base.html\" %}\n\n {% block container %}\n
\n {% block main %}\n {% endblock %}\n
\n {% endblock container %}\n\nWithout `render_wrapper`, that would be all the customization we could do to a\nform. The ``input`` tag for, say, the login form would be at\n``body>div.container>div.auth-container>form>input(s)``. What if our design\nrequires an html element between ``form`` and the form ``input``'s? That would\nnot be possible without overriding each form implementation (not acceptable, you\nmight as well not use Keg-Login at that point, or create something like\n``render_wrapper``.\n\nTo use ``render_wrapper``, in your `macros.html` file but this...\n\n.. code::\n\n {% macro render_wrapper() %}\n {# the form being rendered (login/forgot password/etc) will be rendered\n whereever this is placed #}\n {{ caller() }}\n {% endmacro %}\n\n\nIf you want to wrap the ``form`` element in a div...\n\n.. code::\n\n {% macro render_wrapper() %}\n
\n {{ caller() }}\n
\n {% endmacro %}\n\nNow, all of the keg-login forms will get this treatment.\n\nDevelopment\n***********\n\nBranches & State\n================\n\n* `master`: our \"production\" branch\n\nAll other branches are feature branches.\n\nEnvironment\n===========\n\nInstall requirements:\n\n`$ pip install --use-wheel --no-index --find-links=requirements/wheelhouse -r requirements/dev-env.txt`\n`$ pip install -e .`", "description_content_type": null, "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/level12/keg-login", "keywords": "", "license": "", "maintainer": "", "maintainer_email": "", "name": "KegLogin", "package_url": "https://pypi.org/project/KegLogin/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/KegLogin/", "project_urls": { "Homepage": "https://github.com/level12/keg-login" }, "release_url": "https://pypi.org/project/KegLogin/0.5.4/", "requires_dist": [ "Flask-Login", "Keg", "KegElements" ], "requires_python": "", "summary": "Authentication views for Keg", "version": "0.5.4" }, "last_serial": 4483211, "releases": { "0.5.0": [ { "comment_text": "", "digests": { "md5": "9b4657410ee3fe31f636f312cd7e836d", "sha256": "595bafd250fe87eaa9983f0b9f423c9317929ef8d941b7eae4ae06ce5f52b395" }, "downloads": -1, "filename": "KegLogin-0.5.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "9b4657410ee3fe31f636f312cd7e836d", "packagetype": "bdist_wheel", "python_version": "3.5", "requires_python": null, "size": 17430, "upload_time": "2016-09-22T21:43:04", "url": "https://files.pythonhosted.org/packages/6c/aa/e6b89b43deec17c769f2b7b0a0d8b1575cbe0ca40dabeac146e838f1bd67/KegLogin-0.5.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "256bee780236a01ebfb8f424e1ca2e50", "sha256": "75b1ca342b2826e589a9c1ba0dc1091bcdce3b66784168ee77fc1f4f96ff0d88" }, "downloads": -1, "filename": "KegLogin-0.5.0.tar.gz", "has_sig": false, "md5_digest": "256bee780236a01ebfb8f424e1ca2e50", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 11945, "upload_time": "2016-09-22T21:43:16", "url": "https://files.pythonhosted.org/packages/a1/51/73082f4cac9037c85ac8551bc102b01aa87362f22c2fa931a5220e38bdcb/KegLogin-0.5.0.tar.gz" } ], "0.5.1": [ { "comment_text": "", "digests": { "md5": "3920d6f10242cd602c5290fd0d430231", "sha256": "4714626c210cc97d77170f558f933806ec31a5fec23705af9f99806f3d0c468d" }, "downloads": -1, "filename": "KegLogin-0.5.1-py2.py3-none-any.whl", "has_sig": true, "md5_digest": "3920d6f10242cd602c5290fd0d430231", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 17836, "upload_time": "2016-11-11T23:51:04", "url": "https://files.pythonhosted.org/packages/de/20/0a0ef1c72901624b7a93653211a150c7adeffe741925482df56111e89b8b/KegLogin-0.5.1-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "ff5dec16b7596e67166b23fc226deb98", "sha256": "f9af0ecf64b48b99fe6439225ea812b1e7b70b6c9f70cd606ab5507d4fd28bd5" }, "downloads": -1, "filename": "KegLogin-0.5.1.tar.gz", "has_sig": true, "md5_digest": "ff5dec16b7596e67166b23fc226deb98", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 12364, "upload_time": "2016-11-11T23:51:07", "url": "https://files.pythonhosted.org/packages/96/27/f443b199e26b029ec62cb312a0741905aadb3d8b15e14dffb967de4e65fc/KegLogin-0.5.1.tar.gz" } ], "0.5.2": [ { "comment_text": "", "digests": { "md5": "1e80dc4f4e7bb3bef0c6c26da94e6942", "sha256": "ab7d77753813b869ef2df0fddbc522e3ea206fc605320ff09b81d63d7085200c" }, "downloads": -1, "filename": "KegLogin-0.5.2-py2.py3-none-any.whl", "has_sig": true, "md5_digest": "1e80dc4f4e7bb3bef0c6c26da94e6942", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 17789, "upload_time": "2016-12-06T18:33:24", "url": "https://files.pythonhosted.org/packages/3f/94/60836fd2de1a97507e05b218cc3271a3879635dc486eb2ef4a4afebd77cf/KegLogin-0.5.2-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "c04ad68edbfab2c616fbd27472774b86", "sha256": "0e59e96ee0f20dfcecb61ed8cbbd2e99e7ec395cd70f277380d3c3e8733da6e2" }, "downloads": -1, "filename": "KegLogin-0.5.2.tar.gz", "has_sig": true, "md5_digest": "c04ad68edbfab2c616fbd27472774b86", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 12359, "upload_time": "2016-12-06T18:33:26", "url": "https://files.pythonhosted.org/packages/6c/d9/64210220d7d991792a6555d6b759e8d67127b36c778eab33316d4c081927/KegLogin-0.5.2.tar.gz" } ], "0.5.3": [ { "comment_text": "", "digests": { "md5": "5be2148d89406aff44ac9a3b75e2a5c7", "sha256": "f4be4fac92c24a0900130f7ed31d2909139d43bd63da524bd4bb8562b548954b" }, "downloads": -1, "filename": "KegLogin-0.5.3-py2.py3-none-any.whl", "has_sig": true, "md5_digest": "5be2148d89406aff44ac9a3b75e2a5c7", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 21052, "upload_time": "2017-04-08T20:51:23", "url": "https://files.pythonhosted.org/packages/89/3a/17da0e9309764f61e922ed635e2461d6a4d3fbc3f0a40cb9d741cb692afd/KegLogin-0.5.3-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "be51b753626d17efe55ad52886b84385", "sha256": "1f514ae6cfebacaac1d3a56272fafae22a6a24610d1053411bd6e9d18cffbfe2" }, "downloads": -1, "filename": "KegLogin-0.5.3.tar.gz", "has_sig": true, "md5_digest": "be51b753626d17efe55ad52886b84385", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 18302, "upload_time": "2017-04-08T20:51:26", "url": "https://files.pythonhosted.org/packages/79/bc/5f701f049ce265cdc19dbf39e46a43aac714d1580e63e0130aef4c16021c/KegLogin-0.5.3.tar.gz" } ], "0.5.4": [ { "comment_text": "", "digests": { "md5": "e866cc7a129d38434364531cc0760868", "sha256": "7fa652e6a7ad5b062b305ab301f3a31a876ec9922903028d94af754416cc14f5" }, "downloads": -1, "filename": "KegLogin-0.5.4-py2.py3-none-any.whl", "has_sig": true, "md5_digest": "e866cc7a129d38434364531cc0760868", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 25612, "upload_time": "2017-05-02T15:58:37", "url": "https://files.pythonhosted.org/packages/53/53/eead14d35aa03f67188d780cb8b6a8685b701703382579b2998f53bae112/KegLogin-0.5.4-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "a3955f2c5d84ad6b069a7755ff33e5d9", "sha256": "1727f53047ba47fdfa9783b4e16ac2b7e8d15a9f9fb0b51742d0917d477148f4" }, "downloads": -1, "filename": "KegLogin-0.5.4.tar.gz", "has_sig": true, "md5_digest": "a3955f2c5d84ad6b069a7755ff33e5d9", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 21373, "upload_time": "2017-05-02T15:58:39", "url": "https://files.pythonhosted.org/packages/e6/6a/13f585bf41366a52f4c3e9e05eec3551bc2a92b7f42c49e0e0b5029cf462/KegLogin-0.5.4.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "e866cc7a129d38434364531cc0760868", "sha256": "7fa652e6a7ad5b062b305ab301f3a31a876ec9922903028d94af754416cc14f5" }, "downloads": -1, "filename": "KegLogin-0.5.4-py2.py3-none-any.whl", "has_sig": true, "md5_digest": "e866cc7a129d38434364531cc0760868", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 25612, "upload_time": "2017-05-02T15:58:37", "url": "https://files.pythonhosted.org/packages/53/53/eead14d35aa03f67188d780cb8b6a8685b701703382579b2998f53bae112/KegLogin-0.5.4-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "a3955f2c5d84ad6b069a7755ff33e5d9", "sha256": "1727f53047ba47fdfa9783b4e16ac2b7e8d15a9f9fb0b51742d0917d477148f4" }, "downloads": -1, "filename": "KegLogin-0.5.4.tar.gz", "has_sig": true, "md5_digest": "a3955f2c5d84ad6b069a7755ff33e5d9", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 21373, "upload_time": "2017-05-02T15:58:39", "url": "https://files.pythonhosted.org/packages/e6/6a/13f585bf41366a52f4c3e9e05eec3551bc2a92b7f42c49e0e0b5029cf462/KegLogin-0.5.4.tar.gz" } ] }