{ "info": { "author": "comk", "author_email": "1943336161@qq.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Intended Audience :: Developers", "License :: OSI Approved :: BSD License", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: Implementation", "Topic :: Software Development :: Libraries" ], "description": "comk_django_account\n========================\ncomk\u4e2a\u4eba\u5f00\u53d1\u7684account\u6a21\u578b\uff0c\u7528\u4e8e\u6784\u5efaRSA-SHA256\u9a8c\u8bc1\u7684\u6743\u9650\u7cfb\u7edf\n\n\u73b0\u6709\u529f\u80fd\n========================\n\n1. model\u6784\u5efa\n-------------------------------------------------------------------------------\n#. \u5148\u5728settings\u4e2d\u8fdb\u884c\u914d\u7f6e::\n\n INSTALLED_APPS = [\n 'django.contrib.admin',\n 'django.contrib.auth',\n 'django.contrib.contenttypes',\n 'django.contrib.sessions',\n 'django.contrib.messages',\n 'django.contrib.staticfiles',\n 'comk_django_account.apps.ComkDjangoAccountConfig', # \u52a0\u4e0a\u8fd9\u4e00\u884c\n ]\n\n#. \u518d\u6267\u884c migrate \u547d\u4ee4::\n\n\n python manage.py\n\n2. \u6dfb\u52a0\u8d26\u6237\n-------------------------------------------------------------------------------\n#. \u5728urls.py\u4e0b\u52a0\u4e0aurl\u914d\u7f6e::\n\n from django.conf.urls import url, include\n from django.contrib import admin\n\n urlpatterns = [\n url(r'^admin/', admin.site.urls),\n url(r'^', include('comk_django_account.urls')),\n ]\n\n#. \u901a\u8fc7API\u521b\u5efa\u8d26\u6237::\n\n url= '/acount_action/'\n request_data = dict(\n method='account.add', # \u5fc5\u4f20\u53c2\u6570\n description='\u6d4b', # \u8d26\u6237\u63cf\u8ff0\n appid='381', # \u8d26\u6237id\n pri_key=pri_key, # \u79c1\u94a5\n own_public_key=own_public_key, # \u516c\u94a5\n other_public_key=other_public_key, # \u5bf9\u65b9\u516c\u94a5\n )\n request.post(url,json=request_data)\n\n\n3. \u8bbe\u7f6e\u52a0\u5bc6\u89e3\u5bc6Key\n-------------------------------------------------------------------------------\n\u5bf9\u4e8e\u67d0\u4e9b\u6570\u636e\u6765\u8bf4\uff0c\u662f\u975e\u5e38\u91cd\u8981\u7684\uff0c\u90a3\u4e48\u5c31\u4e0d\u80fd\u660e\u6587\u5b58\u50a8\u5728\u6570\u636e\u5e93\u4e2d\uff0c\u5fc5\u987b\u52a0\u5bc6\u5b58\u50a8\uff0c\u800c\u4e14\uff0c\u4e3a\u4e86\u65b9\u4fbf\u4f7f\u7528\uff0c\u5fc5\u987b\u662f\u53ef\u9006\u52a0\u5bc6\u3002\n\n\u5728\u6b64\u4f7f\u7528\u7684\u52a0\u5bc6\u7b97\u6cd5\u662fAES\u5bf9\u79f0\u52a0\u5bc6\uff0c\u8fd9\u5c31\u6d89\u53ca\u5230\u4e00\u4e2a\u95ee\u9898\uff0cKey\u7684\u503c\u3002\n\n\u8fd9\u91cc\u4f7f\u7528\u4e86\u4e00\u4e2a\u9ed8\u8ba4\u7684\u503c\uff0c\u4f46\u662f\u5bf9\u4e8e\u751f\u4ea7\u7684\u9879\u76ee\u6765\u8bf4\uff0c\u4e0d\u5efa\u8bae\u4f7f\u7528\u9ed8\u8ba4\u7684\u503c\uff0c\u5728\u6b64\u63d0\u4f9b\u4e00\u4e2a\u8bbe\u7f6e\u8be5Key\u503c\u7684\u65b9\u6cd5\uff0c\u9700\u8981\u5728setting\u6587\u4ef6\u4e2d\u914d\u7f6e\uff0c\u5982\u4e0b::\n\n setting.py\n\n from comk_django_account import set_account_aes_key\n set_account_aes_key(Key) # Key\u503c\u5728\u672c\u5305\u5185\uff0c\u9650\u5b9a\u4e3a32\u4f4d\u3002\n\n\n\n4. \u6743\u9650\u6821\u9a8c\n-------------------------------------------------------------------------------\n#. \u5bf9\u4e8e\u670d\u52a1\u65b9\u6765\u8bf4\uff0c\u8fd9\u91cc\u63d0\u4f9b\u4e00\u4e2a\u9ed8\u8ba4\u7684\u6743\u9650\u6821\u9a8c\u65b9\u5f0f\uff0c\u53ea\u9700\u8981\u52a0\u4e0a\u88c5\u9970\u5668\u5373\u53ef\uff0c\u4f7f\u7528\u65b9\u6cd5\u5982\u4e0b::\n\n\n from comk_django_account.views.utils.app_check import request_to_response\n @method_decorator(request_to_response, name='dispatch') # \u7528\u6237\u8bbf\u95ee\u6743\u9650\u6821\u9a8c\uff0c\u4ee5\u53ca\u4e1a\u52a1\u6b63\u5e38\u5931\u8d25\u5904\u7406\n class Server(View):\n \"\"\"\n \u63d0\u4f9b\u7684\u670d\u52a1\n\n \"\"\"\n\n#. \u9ed8\u8ba4\u7684\u6743\u9650\u6821\u9a8c\u65b9\u5f0f\u7684\u8981\u6c42::\n\n 1. \u6743\u9650\u6821\u9a8c\u5fc5\u987b\u9650\u5b9a\u4e3aPOST\u8bf7\u6c42\uff0c\u4e14\u4ea4\u4e92\u6570\u636e\u5fc5\u987b\u662fJSON\u5b57\u7b26\u4e32\u3002\n 2. \u5fc5\u987b\u6709appid\u3001method\u3001timestamp\u3001content\u3001sign\u5b57\u6bb5\n 3. timestamp\u7684\u683c\u5f0f\u4e3a'2019-01-01 00:00:00'\n 4. content\u5fc5\u987b\u662f\u952e\u503c\u5bf9\n 5. \u8be5\u88c5\u9970\u5668\u5df2\u7ecf\u786e\u5b9a\u8fd4\u56deJsonResponse\uff0c\u56e0\u4e3a\u539fServer\u53ea\u9700\u8981\u8fd4\u56dedict\u6570\u636e\u5c31\u884c\uff0c\u88c5\u9970\u5668\u4f1a\u8fdb\u884c\u5c01\u88c5\n\n#. \u53ef\u4ee5\u6839\u636e\u6b64\u68c0\u9a8c\u65b9\u5f0f\u5b9e\u73b0\u81ea\u5df1\u7684\u6743\u9650\u6821\u9a8c\u65b9\u6cd5\n\n5. \u8c03\u7528\u670d\u52a1\n-------------------------------------------------------------------------------\n#. \u4e0e\u4e0a\u9762\u7684\u9ed8\u8ba4\u6743\u9650\u6821\u9a8c\u76f8\u5bf9\uff0c\u5bf9\u4e8e\u8c03\u7528\u65b9\u6765\u8bf4\uff0c\u9700\u8981\u52a0\u7b7e\u540d\u901a\u8fc7\u8ba4\u8bc1::\n\n from comk_django_account.views.utils.sign_utils import get_sign\n def get_sign(pri_key, r_data):\n '''\n \u83b7\u53d6\u7b7e\u540d\n\n :param pri_key: \u79c1\u94a5\n :param r_data: \u4e00\u4e2adict\u6570\u636e\n :return:\n '''\n\n \u53d6\u5f97\u952e\u4e3asign\u3001\u503c\u4e3a\u7b7e\u540d\u503c\u7684\u952e\u503c\u5bf9\n\n#. \u4e3a\u65b9\u4fbf\u8c03\u7528\u8005\uff0c\u53ef\u4f7f\u7528 params_utils \u4e0b\u7684 build_request_params \u6216 make_params_with_sign \u65b9\u6cd5\uff0c\u76f4\u63a5\u6784\u9020\u51fa\u8bf7\u6c42\u6570\u636e\u3002\n\n6. \u5176\u4ed6\n-------------------------------------------------------------------------------\n\u9700\u8981\u6ce8\u610f\u7684\u662f\uff0c\u6743\u9650\u6821\u9a8c\u4e0e\u8c03\u7528\u65b9\u6cd5\u662f\u9700\u8981\u5bf9\u5e94\u7684\u3002\u4f8b\u5982\uff0c\u670d\u52a1\u65b9\u5355\u72ec\u5b9e\u73b0\u4e86\u4e00\u4e2a\u6821\u9a8c\u65b9\u6cd5\uff0c\u800c\u8c03\u7528\u65b9\u4f7f\u7528\u9ed8\u8ba4\u7684\u52a0\u7b7e\u65b9\u6cd5\uff0c\u8fd9\u662f\u4e0d\u884c\u7684\u3002", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "", "keywords": "", "license": "BSD License", "maintainer": "comk", "maintainer_email": "1943336161@qq.com", "name": "comk-django-account", "package_url": "https://pypi.org/project/comk-django-account/", "platform": "all", "project_url": "https://pypi.org/project/comk-django-account/", "project_urls": null, "release_url": "https://pypi.org/project/comk-django-account/1.0.5/", "requires_dist": null, "requires_python": "", "summary": "comk\u4e2a\u4eba\u5f00\u53d1\u7684account\u6a21\u578b\uff0c\u7528\u4e8e\u6784\u5efaRSA-SHA256\u9a8c\u8bc1\u7684\u6743\u9650\u7cfb\u7edf", "version": "1.0.5" }, "last_serial": 5840857, "releases": { "1.0.0": [ { "comment_text": "", "digests": { "md5": "90217b6cac4d9cd231d442d6f68286ed", "sha256": "4b50728ac81c8cf401e50636003198070e610e0f53e9eb6ade0cab041dbdd4fe" }, "downloads": -1, "filename": "comk_django_account-1.0.0.tar.gz", "has_sig": false, "md5_digest": "90217b6cac4d9cd231d442d6f68286ed", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 11388, "upload_time": "2019-04-25T01:50:15", "url": "https://files.pythonhosted.org/packages/6e/48/61a1279f70cd9f81798ab8a00f54e127b5675990f83d7eb076accc4d6c22/comk_django_account-1.0.0.tar.gz" } ], "1.0.1": [ { "comment_text": "", "digests": { "md5": "c1381ea8265d04fd334dded206b5b32f", "sha256": "9ab77a26bd1c5670ea7a725d6993d05ca103166aa12328eebeb17642507f82eb" }, "downloads": -1, "filename": "comk_django_account-1.0.1.tar.gz", "has_sig": false, "md5_digest": "c1381ea8265d04fd334dded206b5b32f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 11721, "upload_time": "2019-04-25T02:45:08", "url": "https://files.pythonhosted.org/packages/c6/a2/aee7c7d9c831d1a583fa63549acb2b3141ea983a2fd2fa1fb420c0b1b76e/comk_django_account-1.0.1.tar.gz" } ], "1.0.2": [ { "comment_text": "", "digests": { "md5": "4c07f6c4f90ccbd48fb1b8a0d1e4170b", "sha256": "200262f0981866242534b4ffa89255216f3591c058e13bd5d7e9815eadc72261" }, "downloads": -1, "filename": "comk_django_account-1.0.2.tar.gz", "has_sig": false, "md5_digest": "4c07f6c4f90ccbd48fb1b8a0d1e4170b", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 11756, "upload_time": "2019-04-25T06:49:35", "url": "https://files.pythonhosted.org/packages/94/f8/564d593a0e504160774f9a99f16968ae784ca7f28666f938e5d73e32b01b/comk_django_account-1.0.2.tar.gz" } ], "1.0.3": [ { "comment_text": "", "digests": { "md5": "cd34731b0943ead3f0c3df2d67efc3ec", "sha256": "a2372227bf17bcd3c056211c2b9374b7b2229bbc7351f971100a05b640541b68" }, "downloads": -1, "filename": "comk_django_account-1.0.3.tar.gz", "has_sig": false, "md5_digest": "cd34731b0943ead3f0c3df2d67efc3ec", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 11908, "upload_time": "2019-04-25T08:30:42", "url": "https://files.pythonhosted.org/packages/8a/a5/0307a0f773022f12fc92732085b97623911118b069f06a8e391ae22cc829/comk_django_account-1.0.3.tar.gz" } ], "1.0.4": [ { "comment_text": "", "digests": { "md5": "fd50d083048aee17bdf6bc0538a46fc1", "sha256": "892f8a199e58688543f6556e3b80347d15870c7a15e52adb324c769da714c145" }, "downloads": -1, "filename": "comk_django_account-1.0.4.tar.gz", "has_sig": false, "md5_digest": "fd50d083048aee17bdf6bc0538a46fc1", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 12395, "upload_time": "2019-05-08T07:15:30", "url": "https://files.pythonhosted.org/packages/21/55/ce6554be6a17592400c06863ff573d0357b39e3a2cac17ae7b46207f978c/comk_django_account-1.0.4.tar.gz" } ], "1.0.5": [ { "comment_text": "", "digests": { "md5": "7ec06154cc8dc10f0c2283cf3563da97", "sha256": "58b1df3b4474847563cd5dc22bae16801aae703cb5a85921ec02734a5c088f7a" }, "downloads": -1, "filename": "comk_django_account-1.0.5.tar.gz", "has_sig": false, "md5_digest": "7ec06154cc8dc10f0c2283cf3563da97", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 12497, "upload_time": "2019-09-17T10:07:16", "url": "https://files.pythonhosted.org/packages/f2/17/c99ef4315421a44757006de67360f11a873a5400cd0368ad63a7822c1515/comk_django_account-1.0.5.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "7ec06154cc8dc10f0c2283cf3563da97", "sha256": "58b1df3b4474847563cd5dc22bae16801aae703cb5a85921ec02734a5c088f7a" }, "downloads": -1, "filename": "comk_django_account-1.0.5.tar.gz", "has_sig": false, "md5_digest": "7ec06154cc8dc10f0c2283cf3563da97", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 12497, "upload_time": "2019-09-17T10:07:16", "url": "https://files.pythonhosted.org/packages/f2/17/c99ef4315421a44757006de67360f11a873a5400cd0368ad63a7822c1515/comk_django_account-1.0.5.tar.gz" } ] }