{ "info": { "author": "erliang", "author_email": "dev@erliang.me", "bugtrack_url": null, "classifiers": [ "Development Status :: 2 - Pre-Alpha", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5" ], "description": "===============================\ndjango-hfut-auth\n===============================\n\n.. image:: https://img.shields.io/github/license/er1iang/django-hfut-auth.svg\n :target: https://github.com/er1iang/django-hfut-auth/blob/master/LICENSE\n\n.. image:: https://img.shields.io/pypi/v/django-hfut-auth.svg\n :target: https://pypi.python.org/pypi/django-hfut-auth\n\n.. image:: https://img.shields.io/travis/er1iang/django-hfut-auth.svg\n :target: https://travis-ci.org/er1iang/django-hfut-auth\n\n.. image:: https://img.shields.io/coveralls/er1iang/django-hfut-auth.svg?maxAge=2592000\n :target: https://coveralls.io/github/er1iang/django-hfut-auth\n\n\n\u4f7f\u7528\u5408\u5de5\u5927\u6559\u52a1\u63a5\u53e3\u8fdb\u884c\u7528\u6237\u8eab\u4efd\u8ba4\u8bc1, \u652f\u6301\u5408\u80a5\u6821\u533a\u548c\u5ba3\u57ce\u6821\u533a\n\ndjango-hfut-auth \u662f\u4e00\u4e2a\u5408\u80a5\u5de5\u4e1a\u5927\u5b66\u5b66\u751f\u7528\u6237\u7684\u7edf\u4e00\u8eab\u4efd\u8ba4\u8bc1\u7684\u5de5\u5177, \u76ee\u7684\u662f\u7b80\u5316\u4f7f\u7528 Django \u5f00\u53d1\u5408\u5de5\u5927\u5b66\u751f\u76f8\u5173\u7f51\u7ad9\u7684\u7528\u6237\u8ba4\u8bc1\u8fc7\u7a0b.\n\n\u529f\u80fd\u7279\u6027\n--------------------\n\n- \u591a\u7248\u672c\u652f\u6301, \u540c\u65f6\u652f\u6301Python2\u548cPython3\n- \u4f7f\u7528\u7b80\u5355, \u53ea\u9700\u914d\u7f6e\u597d\u4e24\u4e2a\u914d\u7f6e\u9879\u5c31\u53ef\u4ee5\u5de5\u4f5c, \u540c\u65f6\u81ea\u5e26\u4e86\u767b\u5f55\u8868\u5355\n- \u7075\u6d3b\u6027\u9ad8, \u4f60\u53ef\u4ee5\u81ea\u5b9a\u4e49\u53ef\u7528\u7684\u6821\u533a, \u8ba4\u8bc1\u6210\u529f\u6216\u5931\u8d25\u65f6\u6240\u8fdb\u884c\u7684\u64cd\u4f5c\n- \u4fb5\u5165\u6027\u5c0f, \u4f60\u51e0\u4e4e\u4e0d\u9700\u8981\u600e\u4e48\u4fee\u6539\u4f60\u7684\u4ee3\u7801\u903b\u8f91\u5c31\u80fd\u96c6\u6210\u57fa\u4e8e\u5408\u5de5\u5927\u6559\u52a1\u4fe1\u606f\u7684\u5b66\u751f\u8eab\u4efd\u8ba4\u8bc1\n- \u53ef\u7528\u6027\u5f3a, \u53ea\u6709\u5728\u5176\u4ed6\u8ba4\u8bc1\u65b9\u5f0f\u5931\u8d25\u540c\u65f6\u63d0\u4f9b\u7684\u8ba4\u8bc1\u4fe1\u606f\u683c\u5f0f\u6b63\u786e\u65f6\u624d\u4f1a\u5411\u6559\u52a1\u7cfb\u7edf\u53d1\u9001\u8bf7\u6c42, \u907f\u514d\u4e86\u9519\u8bef\u7684\u7528\u6237\u8f93\u5165\u548c\u9ad8\u9891\u64cd\u4f5c\u5bfc\u81f4\u7684IP\u9501\u5b9a\u95ee\u9898\n\n\u4f9d\u8d56\n____________________\n\ndjango-hfut-auth \u4f9d\u8d56\u5982\u4e0b::\n\n django>=1.9\n hfut-stu-lib>=1.4.1\n\n\u5176\u4e2d\u7531\u4e8e `django 1.9 \u7248\u672c\u652f\u6301 Python 2.7, 3.4, 3.5 \u7248\u672c `_ ,\n\u76f8\u5e94\u7684, django-hfut-auth \u4e5f\u652f\u6301\u4e0a\u8ff0\u51e0\u4e2a\u7248\u672c\n\n\u5b89\u88c5\n--------------------\n\n\u4f60\u53ea\u9700\u8981\u5728\u547d\u4ee4\u884c\u4e0b\u8f93\u5165\u4e00\u4e0b\u4ee3\u7801\u4fbf\u80fd\u5b89\u88c5\u597d django-hfut-auth::\n\n $ pip install django-hfut-auth\n\n\u5982\u679c\u4f60\u6ca1\u6709\u5b89\u88c5 `pip `_ \uff0c\n`Python \u5b89\u88c5\u5305\u6307\u5357 `_\n\u80fd\u591f\u6307\u5bfc\u4f60\u5b89\u88c5 PIP .\n\n\u914d\u7f6e\n-----------\nsettings.py::\n\n INSTALLED_APPS = (\n ...\n # \u5fc5\u8981\u7684 APP\n 'django.contrib.auth',\n 'django.contrib.contenttypes',\n # \u6dfb\u52a0 APP\n 'hfut_auth',\n ...\n )\n AUTHENTICATION_BACKENDS = (\n ...\n # \u5fc5\u8981\u7684\u8ba4\u8bc1\u540e\u7aef\n 'django.contrib.auth.backends.ModelBackend',\n # \u5c06 HFUTBackend \u653e\u5728 ModelBackend \u540e\u9762, \u786e\u4fdd\u5148\u4ece\u672c\u5730\u6570\u636e\u5e93\u8ba4\u8bc1\n 'hfut_auth.backends.HFUTBackend',\n ...\n )\n\n # \u5176\u4ed6\u914d\u7f6e, \u53f3\u4fa7\u4e3a\u9ed8\u8ba4\u503c\n # \u652f\u6301\u8ba4\u8bc1\u7684\u6821\u533a, \u5ba3\u57ce\u6821\u533a\u4e3a'XC', \u5408\u80a5\u6821\u533a\u4e3a'HF', \u6240\u6709\u6821\u533a\u4e3a'ALL'\n HFUT_AUTH_CAMPUS = 'ALL'\n\n\n\u4f7f\u7528\n--------------------\n\n\u914d\u7f6e\u5b8c\u6210\u540e, \u6309\u7167\u4e00\u822c\u7684\u8ba4\u8bc1\u65b9\u5f0f\u8ba4\u8bc1\u5373\u53ef. \u6ce8\u610f\u5f53 HFUT_AUTH_CAMPUS = 'ALL' \u65f6, \u8c03\u7528 ``django.contrib.auth.authenticate`` \u9700\u8981\u63d0\u4f9b ``campus`` \u53c2\u6570\u6307\u660e\u662f\u54ea\u4e2a\u6821\u533a.\n\n\u76f8\u5e94\u7684, \u5b83\u63d0\u4f9b\u4e86 ``hfut_auth.forms.AuthenticationForm`` , \u5b83\u96c6\u6210\u81ea ``django.contrib.auth.forms.AuthenticationForm`` ,\n\u80fd\u591f\u81ea\u52a8\u7684\u6839\u636e\u914d\u7f6e\u6dfb\u52a0 ``campus`` \u8868\u5355\u5b57\u6bb5, \u5176\u4ed6\u7684\u4e0e\u7236\u7c7b\u6ca1\u6709\u4efb\u4f55\u533a\u522b.\n\n\u4fe1\u53f7\n___________________\n\n``hfut_auth.signals.hfut_auth_succeeded``:\n\n\u5f53\u901a\u8fc7 ``hfut_auth.backends.HFUTBackend`` \u8ba4\u8bc1\u6210\u529f\u65f6\u53d1\u9001\u7684\u4fe1\u53f7, \u63d0\u4f9b\u4e86 ``user`` , ``session`` \u4e24\u4e2a\u53c2\u6570.\n\n``user`` \u662f\u8ba4\u8bc1\u5f97\u5230\u7684\u7528\u6237,\u6ce8\u610f\u5f53\u6570\u636e\u5e93\u91cc\u6ca1\u6709\u5bf9\u5e94\u8ba4\u8bc1\u8d44\u6599\u7684\u7528\u6237\u65f6, ``user`` \u4e3a ``None`` ,\n\u4f60\u53ef\u4ee5\u63a5\u6536\u6b64\u4fe1\u53f7\u5e76\u63d0\u4f9b\u7528\u6237\u521b\u5efa\u903b\u8f91, \u8fd4\u56de\u4e00\u4e2a\u521b\u5efa\u5b8c\u6210\u7684\u7528\u6237, \u8fd9\u6837\u5c31\u80fd\u7701\u53bb\u7528\u6237\u7684\u521b\u5efa\u89c6\u56fe\u7b49\u7b49\u9ebb\u70e6.\n\n``session`` \u662f\u4e00\u4e2a ``hfut_stu_lib.model.StudentSession`` \u5b9e\u4f8b, \u4f60\u53ef\u4ee5\u4f7f\u7528\u5b83\u8c03\u7528\u6559\u52a1\u63a5\u53e3\u83b7\u53d6\u60f3\u8981\u7684\u6570\u636e.\n\n``hfut_auth.signals.hfut_auth_failed``:\n\n\u5f53\u901a\u8fc7 ``hfut_auth.backends.HFUTBackend`` \u8ba4\u8bc1\u5931\u8d25\u65f6\u53d1\u9001\u7684\u4fe1\u53f7, \u63d0\u4f9b\u4e86 ``reason`` , ``credentials`` \u4e24\u4e2a\u53c2\u6570\n\n``reason`` \u662f\u4e00\u4e2a\u9519\u8bef\u5b9e\u4f8b, \u5b83\u544a\u8bc9\u4f60\u8ba4\u8bc1\u5931\u8d25\u7684\u539f\u56e0.\n\n``credentials`` \u662f\u8c03\u7528 ``django.contrib.auth.authenticate`` \u65f6\u63d0\u4f9b\u7684\u53c2\u6570, \u6ce8\u610f\u4e3a\u4e86\u5b89\u5168\u8003\u8651, \u8bf8\u5982\u5bc6\u7801,Token\u7b49\u654f\u611f\u4fe1\u606f\u90fd\u88ab\u66ff\u6362\u4e86\n\n\u6388\u6743\u534f\u8bae\n___________________\n\n* Free software: MIT license\n\n\n..\n **\u529f\u80fd\u548c\u6539\u8fdb**\n\n **\u63a5\u53e3\u6539\u53d8**\n\n **\u884c\u4e3a\u6539\u53d8**\n\n **\u95ee\u9898\u4fee\u590d**\n\n **\u6587\u6863**\n\n **\u5176\u4ed6\u6742\u9879**\n\n.. :changelog:\n\n\u5f00\u53d1\u65e5\u5fd7\n---------------\n\n0.1.2 (2016-08-25)\n------------------\n\n- \u7531\u4e8e django 1.9 \u7248\u672c\u53ea\u652f\u6301 Python 2.7, 3.4, 3.5 \u7248\u672c, \u76f8\u5e94\u7684\u79fb\u9664\u4e86 Python 3.3 \u7684\u652f\u6301\n- \u66f4\u65b0\u4e86\u6587\u6863\n\n\n", "description_content_type": null, "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/er1iang/django-hfut-auth", "keywords": "hfut_auth", "license": "MIT license", "maintainer": "", "maintainer_email": "", "name": "django-hfut-auth", "package_url": "https://pypi.org/project/django-hfut-auth/", "platform": "", "project_url": "https://pypi.org/project/django-hfut-auth/", "project_urls": { "Homepage": "https://github.com/er1iang/django-hfut-auth" }, "release_url": "https://pypi.org/project/django-hfut-auth/0.1.2/", "requires_dist": [ "django (>=1.9)", "hfut (>=1.4.1)" ], "requires_python": "", "summary": "\u4f7f\u7528\u5408\u5de5\u5927\u6559\u52a1\u63a5\u53e3\u8fdb\u884c\u7528\u6237\u8eab\u4efd\u8ba4, \u652f\u6301\u5408\u80a5\u6821\u533a\u548c\u5ba3\u57ce\u6821\u533a", "version": "0.1.2" }, "last_serial": 3802806, "releases": { "0.1.2": [ { "comment_text": "", "digests": { "md5": "6911b54862f09442310bf2accde9c101", "sha256": "7fffbdfa96f23149d2df3e3405f5218db332271aa78701d99ecdc4d1ce32ffbf" }, "downloads": -1, "filename": "django_hfut_auth-0.1.2-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "6911b54862f09442310bf2accde9c101", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 11236, "upload_time": "2016-08-25T05:58:14", "url": "https://files.pythonhosted.org/packages/8c/87/600181f6e3587a9ad779abb31f0a195c7c64cd50b5fe4a80996dafffa4dd/django_hfut_auth-0.1.2-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "24fd854c48eeb8e4f117ddd944ae3b37", "sha256": "0f9458fbbe35c44f7a27cdb5a098a5d8cd89c0435a9c5aebc3df57b6058c4ff2" }, "downloads": -1, "filename": "django-hfut-auth-0.1.2.win-amd64.zip", "has_sig": false, "md5_digest": "24fd854c48eeb8e4f117ddd944ae3b37", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 16677, "upload_time": "2016-08-25T05:58:17", "url": "https://files.pythonhosted.org/packages/d3/a3/aff821cae67cddda0d5fe83696dddd0a3cfb1058cef1c7fe950d17b5edf0/django-hfut-auth-0.1.2.win-amd64.zip" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "6911b54862f09442310bf2accde9c101", "sha256": "7fffbdfa96f23149d2df3e3405f5218db332271aa78701d99ecdc4d1ce32ffbf" }, "downloads": -1, "filename": "django_hfut_auth-0.1.2-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "6911b54862f09442310bf2accde9c101", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 11236, "upload_time": "2016-08-25T05:58:14", "url": "https://files.pythonhosted.org/packages/8c/87/600181f6e3587a9ad779abb31f0a195c7c64cd50b5fe4a80996dafffa4dd/django_hfut_auth-0.1.2-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "24fd854c48eeb8e4f117ddd944ae3b37", "sha256": "0f9458fbbe35c44f7a27cdb5a098a5d8cd89c0435a9c5aebc3df57b6058c4ff2" }, "downloads": -1, "filename": "django-hfut-auth-0.1.2.win-amd64.zip", "has_sig": false, "md5_digest": "24fd854c48eeb8e4f117ddd944ae3b37", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 16677, "upload_time": "2016-08-25T05:58:17", "url": "https://files.pythonhosted.org/packages/d3/a3/aff821cae67cddda0d5fe83696dddd0a3cfb1058cef1c7fe950d17b5edf0/django-hfut-auth-0.1.2.win-amd64.zip" } ] }