{ "info": { "author": "Mirko Darino, Alessandro Molina, Vincenzo Castiglia, Marco Bosio", "author_email": "mirko.darino@axant.it, alessandro.molina@axant.it, vincenzo.castiglia@axant.it, marco.bosio@axant.it", "bugtrack_url": null, "classifiers": [], "description": ".. image:: https://travis-ci.org/axant/tgapp-userprofile.svg?branch=master\n :target: https://travis-ci.org/axant/tgapp-userprofile\n.. image:: https://coveralls.io/repos/github/axant/tgapp-userprofile/badge.svg?branch=master\n :target: https://coveralls.io/github/axant/tgapp-userprofile?branch=master\n\n\nAbout userprofile\n-----------------\n\nuserprofile is a Pluggable application for TurboGears2 which provides a basic user\nprofile page with forms to allow users to edit their own profile or change their password or email.\n\nuserprofile works with both *sqlachemy* and *ming* backends.\n\nInstalling\n----------\n\nuserprofile can be installed both from pypi or from github::\n\n pip install tgapp-userprofile\n\nshould just work for most of the users\n\nPlugging userprofile\n--------------------\n\nIn your application *config/app_cfg.py* import **plug**::\n\n from tgext.pluggable import plug\n\nThen at the *end of the file* call plug with userprofile::\n\n plug(base_config, 'userprofile')\n\nYou will be able to access your profile at\n*http://localhost:8080/userprofile*.\n\nOptions\n-------\n\n``tgapp-userprofile`` supports some options that can be passed\nto the ``plug`` method to customize various aspects of the application:\n\n- ``user_partial`` - Path of a partial to display into the user profile page.\n Useful to add more data to the profile page without changing its template\n- ``custom_css`` - Path to a CSS file which will be used for the profile pages in place of the default one.\n\nUser Properties\n---------------\n\n``tgapp-userprofile`` looks for various properties into the User class instances\nto drive its default behavior, the most important property is the ``profile_data``\nproperty which can provide a dictionary with the user information to display\non the profile page, but other properties are available to tune the behavior:\n\nprofile_data\n~~~~~~~~~~~~\nA dictionary of entries to display into the profile page,\nthe default dictionary is built with::\n\n {'display_name':('Display Name', user.display_name),\n 'email_address':('Email Address', user.email_address)}\n\neach key of the dictionary if the id of the field, in most\ncases it will have the same name of the user property where\nthat field is stored. Values of the dictionary are tuples\nwhere the first value is the name of the field which will\nbe displayed and the second one is the real value of the field.\n\nIf an ``avatar`` key is available that is expected to provide\nthe url of the avatar image of the user. If it is not available\nuserprofile will look for a ``tgapp-fbauth`` facebook avatar or will\nfalleback to the default avatar.\n\n``display_name`` key will be used as the profile page title.\n\nprofile_form\n~~~~~~~~~~~~\n\nA ToscaWidgets or tw2 form that can be used to edit the user profile.\nBy default an autogenerated one with a text field for each entry in\n``profile_data`` is provided.\n\nsave_profile\n~~~~~~~~~~~~\n\nA callable which will receive the user data submitted by the edit\nform and is expected to update the user accordingly.\n\nBy default values will be stored as they are into the user field\nwith the same id provided into ``profile_data``.\n\nBootstrap Layout\n----------------\nIf you want use bootstrap for beautify style of `UserForm` or `ChangePasswordForm` form layout, in your app_cfg::\n\n def replace_profile_form_layout():\n from axf.bootstrap import BootstrapFormLayout\n from userprofile.lib import UserForm\n from userprofile.lib import ChangePasswordForm\n\n UserForm.child = BootstrapFormLayout(children=UserForm.child.children)\n UserForm.submit.css_class = 'btn-primary form-control'\n\n ChangePasswordForm.child = BootstrapFormLayout(children=ChangePasswordForm.child.children)\n ChangePasswordForm.submit.css_class = 'btn-primary form-control'\n\n milestones.config_ready.register(replace_profile_form_layout)\n\n\nAuthentication Configuration\n----------------------------\nSince with `userprofile` a user can change his email address or user name, you have to configure `repoze.who`\nproperly.\nIn `app_cfg.py`, locate the `authenticate` method of `ApplicationAuthMetadata`: it should return the id of the user.\nNow `repoze.who` will save the user id in a cookie to identify the user and since this id will not change, the\nauthentication process allows users to change email addresses and user names safely.\n\nThis example illustrate a login based on user name or email address with Ming::\n\n class ApplicationAuthMetadata(TGAuthMetadata):\n def __init__(self, sa_auth):\n self.sa_auth = sa_auth\n\n def get_query(self, login):\n\n try:\n _id = ObjectId(login)\n except InvalidId:\n _id = login\n\n return {\n '$or': [{'email_address': login},\n {'user_name': login},\n {'_id': _id}],\n 'blocked': {'$ne': True},\n }\n\n def authenticate(self, environ, identity):\n login = identity['login']\n user = self.sa_auth.user_class.query.find(self.get_query(login)).first()\n\n if not user: # pragma: no cover\n login = None\n elif not user.validate_password(identity['password']):\n login = None\n\n if login is None:\n try:\n from urllib.parse import parse_qs, urlencode\n except ImportError:\n from urlparse import parse_qs\n from urllib import urlencode\n from tg.exceptions import HTTPFound\n\n params = parse_qs(environ['QUERY_STRING'])\n params.pop('password', None) # Remove password in case it was there\n if user is None: # pragma: no cover\n params['failure'] = 'user-not-found'\n else:\n params['login'] = identity['login']\n params['failure'] = 'invalid-password'\n\n # When authentication fails send user to login page.\n environ['repoze.who.application'] = HTTPFound(\n location=environ['SCRIPT_NAME'] + '?'.join(('/login', urlencode(params, True)))\n )\n\n return str(user._id) if user and login else login\n\n def get_user(self, identity, userid):\n return self.sa_auth.user_class.query.find(self.get_query(userid)).first()\n\n def get_groups(self, identity, userid):\n return [g.group_name for g in identity['user'].groups]\n\n def get_permissions(self, identity, userid):\n return [p.permission_name for p in identity['user'].permissions]\n\n\n base_config.sa_auth.authmetadata = ApplicationAuthMetadata(base_config.sa_auth)\n\n\n", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/axant/tgapp-userprofile", "keywords": "turbogears2.application", "license": "", "maintainer": "", "maintainer_email": "", "name": "tgapp-userprofile", "package_url": "https://pypi.org/project/tgapp-userprofile/", "platform": "", "project_url": "https://pypi.org/project/tgapp-userprofile/", "project_urls": { "Homepage": "https://github.com/axant/tgapp-userprofile" }, "release_url": "https://pypi.org/project/tgapp-userprofile/0.3.6/", "requires_dist": null, "requires_python": "", "summary": "Pluggable application for TurboGears2 which provides a basic user profile page with forms to allow users to edit their own profile or change their email/password", "version": "0.3.6" }, "last_serial": 4043506, "releases": { "0.0.1": [ { "comment_text": "", "digests": { "md5": "bff417540293a27c8c9ef3249269acd1", "sha256": "540892cb515607a308fa1f12c471f6c7a71a2b2f760befa5c69711326714ec38" }, "downloads": -1, "filename": "tgapp-userprofile-0.0.1.tar.gz", "has_sig": false, "md5_digest": "bff417540293a27c8c9ef3249269acd1", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 14212, "upload_time": "2012-07-16T11:41:41", "url": "https://files.pythonhosted.org/packages/9a/12/50a25e79935652a79bdb389d6717b25afa9630b8d42d67ed16a234c4e6a1/tgapp-userprofile-0.0.1.tar.gz" } ], "0.0.2": [ { "comment_text": "", "digests": { "md5": "fde0f808244f7c39b1b0d661f0ae1e59", "sha256": "4453003edbe452f5288e244c5010f2f099cc2ba27d797ee4af229f9ee6b85971" }, "downloads": -1, "filename": "tgapp-userprofile-0.0.2.tar.gz", "has_sig": false, "md5_digest": "fde0f808244f7c39b1b0d661f0ae1e59", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 14208, "upload_time": "2012-07-17T12:13:48", "url": "https://files.pythonhosted.org/packages/ef/72/c87223aadc7a757d410ce941928ebf825571b0722e99ea0a7ca301bba735/tgapp-userprofile-0.0.2.tar.gz" } ], "0.0.3": [ { "comment_text": "", "digests": { "md5": "029c6d50b96b682584aff787c13b381a", "sha256": "9c9d3242739ee61ca89e04767868fe6f9a90a73fdeca52e0f1d5a7927747ecf3" }, "downloads": -1, "filename": "tgapp-userprofile-0.0.3.tar.gz", "has_sig": false, "md5_digest": "029c6d50b96b682584aff787c13b381a", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 12766, "upload_time": "2012-10-01T10:29:40", "url": "https://files.pythonhosted.org/packages/8a/de/56fd730b47b4512b82274506ad5df2f4831a85a6a2c4de1786308d64c2ed/tgapp-userprofile-0.0.3.tar.gz" } ], "0.0.4": [ { "comment_text": "", "digests": { "md5": "5a2e29d6f1962a32bc13e2b392f714e7", "sha256": "31c5cca8650b6ba2b808a12b0937234981f3b77ae0c4ae2a061811e1b9d924ea" }, "downloads": -1, "filename": "tgapp-userprofile-0.0.4.tar.gz", "has_sig": false, "md5_digest": "5a2e29d6f1962a32bc13e2b392f714e7", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 13056, "upload_time": "2013-03-22T01:20:07", "url": "https://files.pythonhosted.org/packages/c3/59/05f218cbf0b145850d095d1851b3adeff1403e23fead904657f1cf6dc72a/tgapp-userprofile-0.0.4.tar.gz" } ], "0.0.5": [ { "comment_text": "", "digests": { "md5": "b050ef675561fd557b05bea6ca4c0946", "sha256": "018d0e4368405848a933502db86ba4d49c068e9e71e8e64d841f06360df09159" }, "downloads": -1, "filename": "tgapp-userprofile-0.0.5.tar.gz", "has_sig": false, "md5_digest": "b050ef675561fd557b05bea6ca4c0946", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 13045, "upload_time": "2013-06-28T18:12:05", "url": "https://files.pythonhosted.org/packages/4a/36/c8a184c708d4fdcea35c14f14087aa1825c8f89478433c9d087c69ccbf06/tgapp-userprofile-0.0.5.tar.gz" } ], "0.0.6": [ { "comment_text": "", "digests": { "md5": "bbcb63073a239d038f9402e95bbc3be1", "sha256": "10ab9e1b92e8d9904848a5e149e047c40a7f2a99002a39f88aecc0e998b98aa1" }, "downloads": -1, "filename": "tgapp-userprofile-0.0.6.tar.gz", "has_sig": false, "md5_digest": "bbcb63073a239d038f9402e95bbc3be1", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 13570, "upload_time": "2015-10-28T22:04:00", "url": "https://files.pythonhosted.org/packages/20/2a/4c2206861bd3953c14bdad4bb943f550fea9d49c4ba6aa27568fa44a9ce6/tgapp-userprofile-0.0.6.tar.gz" } ], "0.1.0": [ { "comment_text": "", "digests": { "md5": "5ad872287891e9f520c99801781b6255", "sha256": "22652f9c507211977be10b19392988610947d4e2fa0a29c36d72eaf2a18ba328" }, "downloads": -1, "filename": "tgapp-userprofile-0.1.0.tar.gz", "has_sig": false, "md5_digest": "5ad872287891e9f520c99801781b6255", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 13778, "upload_time": "2016-07-19T12:52:00", "url": "https://files.pythonhosted.org/packages/57/f0/f77424b3608a736aa09256fe14bddde1e0bd0565990a28a622cd4c512f5e/tgapp-userprofile-0.1.0.tar.gz" } ], "0.1.1": [ { "comment_text": "", "digests": { "md5": "c3ad7e798fdcc7c20fa35436c31ace34", "sha256": "08f10204a5098dfd89edf2c8557c496a7cc2e4c1ddd77dacc66e4bd3aa2c89fb" }, "downloads": -1, "filename": "tgapp-userprofile-0.1.1.tar.gz", "has_sig": false, "md5_digest": "c3ad7e798fdcc7c20fa35436c31ace34", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 13742, "upload_time": "2016-09-02T17:10:49", "url": "https://files.pythonhosted.org/packages/94/46/2df24dae5107b0035eaae479bbe935ab61257b37e4d089a6e2699aae9e11/tgapp-userprofile-0.1.1.tar.gz" } ], "0.1.2": [ { "comment_text": "", "digests": { "md5": "d2de35cfada3724a42bd8a1a2faec9f9", "sha256": "7a9216dd0b880b44da42be94473af341d76641e375a5b65a1833719b40cc8152" }, "downloads": -1, "filename": "tgapp-userprofile-0.1.2.tar.gz", "has_sig": false, "md5_digest": "d2de35cfada3724a42bd8a1a2faec9f9", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 14292, "upload_time": "2016-09-06T15:01:06", "url": "https://files.pythonhosted.org/packages/fc/36/51185edfdaae8158228664cdb6baea342c9274cd4ebd1cfeb43478978965/tgapp-userprofile-0.1.2.tar.gz" } ], "0.1.3": [ { "comment_text": "", "digests": { "md5": "cb716b64569657d4b00745e580f5cadb", "sha256": "ebcfb57234e03727529e89a230c33c4b8dd763d706ae45b294b6cc808d3cc1ee" }, "downloads": -1, "filename": "tgapp-userprofile-0.1.3.tar.gz", "has_sig": false, "md5_digest": "cb716b64569657d4b00745e580f5cadb", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 15532, "upload_time": "2016-09-07T14:29:04", "url": "https://files.pythonhosted.org/packages/ea/57/d6fed3cd89d8f9d0ee8c9bc4bdf38b3d5eb66c552be799a4dfcbd2e908c2/tgapp-userprofile-0.1.3.tar.gz" } ], "0.2.0": [ { "comment_text": "", "digests": { "md5": "b7f835f96e8529fe50484f5ee01ae474", "sha256": "ff893d5086fc08ea83983b21be476507d02a60e615144aefd316758f501e5174" }, "downloads": -1, "filename": "tgapp-userprofile-0.2.0.tar.gz", "has_sig": false, "md5_digest": "b7f835f96e8529fe50484f5ee01ae474", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 15512, "upload_time": "2016-09-10T16:27:18", "url": "https://files.pythonhosted.org/packages/4a/e6/3a616302cb5ed0a6663a0c2ba4700c6242d82a0efcb6625052fc890a5cf6/tgapp-userprofile-0.2.0.tar.gz" } ], "0.3.0": [ { "comment_text": "", "digests": { "md5": "be73f2c0e06ff5a1d3087d7634468cd6", "sha256": "711c4078e653509513b55387de632359a3ff7cdbe1a6a95ea667ebcc52e64fea" }, "downloads": -1, "filename": "tgapp-userprofile-0.3.0.tar.gz", "has_sig": false, "md5_digest": "be73f2c0e06ff5a1d3087d7634468cd6", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 16555, "upload_time": "2018-02-07T16:44:08", "url": "https://files.pythonhosted.org/packages/26/76/8a06b71dffc2ecc627105250db14018cda7cb98b5576f6aa42733e5572de/tgapp-userprofile-0.3.0.tar.gz" } ], "0.3.1": [ { "comment_text": "", "digests": { "md5": "2d398571db9b55c8e6b345a2749d0a1f", "sha256": "066522ae033874428d487414e09939fa8f6de8259b21a9632caf5992b85b3288" }, "downloads": -1, "filename": "tgapp-userprofile-0.3.1.tar.gz", "has_sig": false, "md5_digest": "2d398571db9b55c8e6b345a2749d0a1f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 16562, "upload_time": "2018-02-07T16:45:41", "url": "https://files.pythonhosted.org/packages/83/69/3a733fb4aeeaac641c15543a494252a5a9e52cdfe4321e496240bd14216c/tgapp-userprofile-0.3.1.tar.gz" } ], "0.3.2": [ { "comment_text": "", "digests": { "md5": "579589b688edda1a4100607fdaa66d13", "sha256": "fd5241f57cfbe773a54f06a7682fc24344c6aa8c41df7ef24131650201645728" }, "downloads": -1, "filename": "tgapp-userprofile-0.3.2.tar.gz", "has_sig": false, "md5_digest": "579589b688edda1a4100607fdaa66d13", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 18365, "upload_time": "2018-02-08T10:49:01", "url": "https://files.pythonhosted.org/packages/5f/8e/122ff29c84ad8498765a6b8a075bbb095668ac0b69c2200ac43c7b5e08e8/tgapp-userprofile-0.3.2.tar.gz" } ], "0.3.3": [ { "comment_text": "", "digests": { "md5": "b829a51c32ef8b8a9f50923d5a3494c4", "sha256": "dc274de0dca7c6715c6b7d46fe755aa2d4939df66a4c4747da21dfb26431d6d0" }, "downloads": -1, "filename": "tgapp-userprofile-0.3.3.tar.gz", "has_sig": false, "md5_digest": "b829a51c32ef8b8a9f50923d5a3494c4", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 16578, "upload_time": "2018-03-28T13:51:56", "url": "https://files.pythonhosted.org/packages/a0/9e/b9eced4ffc6f78ca97acc48311efd1789dd010671e56beab2b57b2398beb/tgapp-userprofile-0.3.3.tar.gz" } ], "0.3.4": [ { "comment_text": "", "digests": { "md5": "4dc1612d46aaa4168aa8a2fbc0a283b4", "sha256": "936afbf486e28ac6f601299f9b729cff1e2082b3d3bfbe119c32a58c31e5869c" }, "downloads": -1, "filename": "tgapp-userprofile-0.3.4.tar.gz", "has_sig": false, "md5_digest": "4dc1612d46aaa4168aa8a2fbc0a283b4", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 16618, "upload_time": "2018-04-27T14:22:00", "url": "https://files.pythonhosted.org/packages/51/5e/7bfdaffbc5230c950cd4e76563ad4d2bf88377ee9744af09dc49bf22287b/tgapp-userprofile-0.3.4.tar.gz" } ], "0.3.5": [ { "comment_text": "", "digests": { "md5": "c0d9a0a41cfcd48b553938990dc43692", "sha256": "5203a47e9044114304e6535e7d8f0275a4383f08222cc76b9d8870b4d5d0ec76" }, "downloads": -1, "filename": "tgapp-userprofile-0.3.5.tar.gz", "has_sig": false, "md5_digest": "c0d9a0a41cfcd48b553938990dc43692", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 22251, "upload_time": "2018-05-18T12:02:57", "url": "https://files.pythonhosted.org/packages/2f/fb/0e0a4a3cd27558b3482d304189172d979d9d2a30e50921abcc10dfb6656f/tgapp-userprofile-0.3.5.tar.gz" } ], "0.3.6": [ { "comment_text": "", "digests": { "md5": "d128cc6adce7fe3d3589c71740bbe570", "sha256": "b16bb4c02cd591304386c7196d01916cb5f19110046402f8d29ffe02c74e9c9c" }, "downloads": -1, "filename": "tgapp-userprofile-0.3.6.tar.gz", "has_sig": false, "md5_digest": "d128cc6adce7fe3d3589c71740bbe570", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 22452, "upload_time": "2018-07-09T12:42:50", "url": "https://files.pythonhosted.org/packages/d6/46/b2e0fd88567044e714d176f2c62acc22bc0530c9bd1fbae2ca440fd7f83f/tgapp-userprofile-0.3.6.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "d128cc6adce7fe3d3589c71740bbe570", "sha256": "b16bb4c02cd591304386c7196d01916cb5f19110046402f8d29ffe02c74e9c9c" }, "downloads": -1, "filename": "tgapp-userprofile-0.3.6.tar.gz", "has_sig": false, "md5_digest": "d128cc6adce7fe3d3589c71740bbe570", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 22452, "upload_time": "2018-07-09T12:42:50", "url": "https://files.pythonhosted.org/packages/d6/46/b2e0fd88567044e714d176f2c62acc22bc0530c9bd1fbae2ca440fd7f83f/tgapp-userprofile-0.3.6.tar.gz" } ] }