{"id":8297,"date":"2021-12-05T02:44:12","date_gmt":"2021-12-05T01:44:12","guid":{"rendered":"https:\/\/myoceane.fr\/?p=8297"},"modified":"2021-12-05T02:56:02","modified_gmt":"2021-12-05T01:56:02","slug":"django-synchronousonlyoperation","status":"publish","type":"post","link":"https:\/\/myoceane.fr\/index.php\/django-synchronousonlyoperation\/","title":{"rendered":"[Django] SynchronousOnlyOperation \u89e3\u6c7a\u65b9\u6cd5"},"content":{"rendered":"<div id=\"fb-root\"><\/div>\n<p style=\"text-align: justify;\">\u5728\u4f7f\u7528 Django Rest Framework \u958b\u767c\u7684\u6642\u5019\u51fa\u73fe SynchronousOnlyOperation \u7684\u932f\u8aa4\uff0c\u672c\u7bc7\u5c55\u793a\u4e00\u500b\u7bc4\u4f8b\u7d00\u9304\u7b46\u8005\u4f7f\u7528 sync_to_async \u7684\u89e3\u6c7a\u65b9\u6cd5\uff0c\u4e00\u958b\u59cb\u770b sync_to_async \u8aaa\u660e\u7684\u6642\u5019\u4e26\u4e0d\u597d\u7406\u89e3\u8981\u600e\u9ebc\u4f7f\u7528\uff0c\u53c3\u8003\u7bc4\u4f8b\u53ef\u4ee5\u6bd4\u8f03\u5bb9\u6613\u4e86\u89e3\uff0c\u95dc\u65bc django \u7684\u4e00\u4e9b\u57fa\u672c\u4ecb\u7d39\u53ef\u4ee5\u53c3\u8003 <a href=\"https:\/\/myoceane.fr\/index.php\/django-%e7%94%a8-python-%e5%af%ab%e7%b6%b2%e9%a0%81%ef%bc%9f\/\">[Django] \u7528 Python \u5beb\u7db2\u9801\uff1f<\/a><\/p>\n<pre class=\"lang:bash\">SynchronousOnlyOperation: You cannot call this from an async context - use a thread or sync_to_async.<\/pre>\n<p>\u5728<a href=\"https:\/\/docs.djangoproject.com\/en\/3.2\/ref\/exceptions\/#django.core.exceptions.SynchronousOnlyOperation\">\u67e5\u8a62 django \u95dc\u65bc SynchronousOnlyOperation<\/a> \u7d66\u51fa\u7684\u8aaa\u660e\u662f\u56e0\u70ba\uff1a<\/p>\n<p style=\"text-align: justify;\">The\u00a0<a class=\"reference internal\" title=\"django.core.exceptions.SynchronousOnlyOperation\" href=\"https:\/\/docs.djangoproject.com\/en\/3.2\/ref\/exceptions\/#django.core.exceptions.SynchronousOnlyOperation\"><code class=\"xref py py-exc docutils literal notranslate\"><span class=\"pre\">SynchronousOnlyOperation<\/span><\/code><\/a>\u00a0exception is raised when code that is only allowed in synchronous Python code is called from an asynchronous context (a thread with a running asynchronous event loop). These parts of Django are generally heavily reliant on thread-safety to function and don\u2019t work correctly under coroutines sharing the same thread.<\/p>\n<p style=\"text-align: justify;\">\u4ed4\u7d30\u67e5\u4e86\u4e00\u4e0b\u6709\u95dc\u9019\u500b error \u7684<a href=\"https:\/\/stackoverflow.com\/questions\/61926359\/django-synchronousonlyoperation-you-cannot-call-this-from-an-async-context-u\">\u4e00\u4e9b\u8a0e\u8ad6<\/a>\u767c\u73fe\u9019\u8207 async code \u4e2d\u662f\u5426\u6709\u4f7f\u7528\u5230 SQL database \u6709\u95dc\u4fc2\uff0c\u4f8b\u5982\u4f60\u6709\u4ee5\u4e0b\u4e00\u500b\u7a0b\u5f0f\u78bc\uff0c\u5728 upload \u7684\u51fd\u5f0f\u88e1\u9762\uff0c\u5229\u7528 aiofiles.open \u53bb\u5e73\u884c\u4e0a\u50b3\u591a\u500b\u6a94\u6848\uff0c\u6240\u4ee5\u9019\u6642\u5019 upload \u5c31\u662f\u4e00\u500b async \u51fd\u5f0f\uff0c\u5047\u8a2d\u5728 get_access_token \u9019\u4e00\u500b\u51fd\u5f0f\u88e1\u9762\u6709\u4f7f\u7528\u5230 SQL database \u5c31\u6703\u5831\u4ee5\u4e0a\u7684\u932f\u8aa4\u3002<\/p>\n<pre class=\"lang:python\">async def upload(self, account: str, path: str, *files) -&gt; str:\n    token = self.get_access_token()\n    \n    for file in files:\n        name = os.path.basename(file)\n        async with aiofiles.open(file, mode=\"rb\") as f:\n            data = await f.read()\n        response = self.request_retry(method='put', data=data)\n        response.raise_for_status()\n    return url<\/pre>\n<h5>\u89e3\u6c7a\u65b9\u6cd5\u4e00\uff1a<\/h5>\n<p>\u8981\u89e3\u6c7a\u9019\u500b\u5831\u932f\u5c31\u662f\u8981 sync_to_async \u5c07\u4e00\u500b sync \u7684\u51fd\u5f0f\u8f49\u6210 async \u80fd\u5920\u63a5\u53d7\u7684\u5f62\u5f0f\uff0c\u6700\u7c21\u55ae\u7684\u89e3\u6c7a\u65b9\u6cd5\u5c31\u662f\u5c07 get_access_token \u88dd\u98fe\u6210 sync_to_async \u5982\u4ee5\u4e0b\u7684\u7a0b\u5f0f\u78bc\uff0c<a href=\"https:\/\/docs.djangoproject.com\/en\/3.2\/topics\/async\/\">\u4ee5\u4e0b\u53c3\u8003<\/a>\uff1a<\/p>\n<pre class=\"lang:python\">from asgiref.sync import async_to_sync\n\n@async_to_sync\nasync def get_access_token(...):<\/pre>\n<p>\u4f46\u662f\u9019\u6a23\u505a\u6709\u4e00\u500b\u7f3a\u9ede\uff0c\u5c31\u662f\u6240\u6709\u4f7f\u7528 get_access_token \u7684\u5176\u4ed6\u5730\u65b9\u90fd\u76f8\u61c9\u4e5f\u8981\u8b8a\u6210 async \u9019\u6709\u6642\u5019\u6703\u53d7\u9650\u3002<\/p>\n<h5>\u89e3\u6c7a\u65b9\u6cd5\u4e8c\uff1a<\/h5>\n<p>\u53e6\u5916\u4e5f\u53ef\u4ee5\u5728\u4f7f\u7528\u7684\u7576\u4e0b\u518d\u5c07 get_access_token \u7684\u51fd\u5f0f\u8f49\u8b8a\u5f62\u5f0f\uff0c\u5982\u4ee5\u4e0b\u7684\u65b9\u5f0f\uff1a<\/p>\n<pre class=\"lang:bash\">async def upload_blob(self, account: str, path: str, *files) -&gt; str:\n    token = await sync_to_async(self.get_access_token)()\n\n    for file in files:\n        name = os.path.basename(file)\n        async with aiofiles.open(file, mode=\"rb\") as f:\n            data = await f.read()\n        response = self.request_retry(method='put', data=data)\n        response.raise_for_status()\n    return url<\/pre>\n<p>\u00a0<\/p>\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u5728\u4f7f\u7528 Django Rest Framework \u958b\u767c\u7684\u6642\u5019\u51fa\u73fe SynchronousOnlyOperation \u7684\u932f\u8aa4\uff0c\u672c\u7bc7\u5c55\u793a\u4e00\u500b\u7bc4\u4f8b\u7d00\u9304\u7b46\u8005\u4f7f\u7528 sync_to_async \u7684\u89e3\u6c7a\u65b9\u6cd5\uff0c\u4e00\u958b\u59cb\u770b sync_to_async \u8aaa\u660e\u7684\u6642\u5019\u4e26\u4e0d\u597d\u7406\u89e3\u8981\u600e\u9ebc\u4f7f\u7528\uff0c\u53c3\u8003\u7bc4\u4f8b\u53ef\u4ee5\u6bd4\u8f03\u5bb9\u6613\u4e86\u89e3\uff0c\u95dc\u65bc django \u7684\u4e00\u4e9b\u57fa\u672c\u4ecb\u7d39\u53ef\u4ee5\u53c3\u8003 [Django] \u7528 Python \u5beb\u7db2\u9801\uff1f<\/p>\n","protected":false},"author":1,"featured_media":8308,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[14,176,8],"tags":[18,19,1489,1488],"class_list":["post-8297","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-it-technology","category-python","category-website","tag-django","tag-python","tag-sync_to_async","tag-synchronousonlyoperation"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v24.6 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>[Django] SynchronousOnlyOperation \u89e3\u6c7a\u65b9\u6cd5 - \u60f3\u65b9\u6d89\u6cd5 - \u91cf\u74f6\u5916\u7684\u5929\u7a7a M-Y-Oceane<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/myoceane.fr\/index.php\/django-synchronousonlyoperation\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"[Django] SynchronousOnlyOperation \u89e3\u6c7a\u65b9\u6cd5 - \u60f3\u65b9\u6d89\u6cd5 - \u91cf\u74f6\u5916\u7684\u5929\u7a7a M-Y-Oceane\" \/>\n<meta property=\"og:description\" content=\"\u5728\u4f7f\u7528 Django Rest Framework \u958b\u767c\u7684\u6642\u5019\u51fa\u73fe SynchronousOnlyOperation \u7684\u932f\u8aa4\uff0c\u672c\u7bc7\u5c55\u793a\u4e00\u500b\u7bc4\u4f8b\u7d00\u9304\u7b46\u8005\u4f7f\u7528 sync_to_async \u7684\u89e3\u6c7a\u65b9\u6cd5\uff0c\u4e00\u958b\u59cb\u770b sync_to_async \u8aaa\u660e\u7684\u6642\u5019\u4e26\u4e0d\u597d\u7406\u89e3\u8981\u600e\u9ebc\u4f7f\u7528\uff0c\u53c3\u8003\u7bc4\u4f8b\u53ef\u4ee5\u6bd4\u8f03\u5bb9\u6613\u4e86\u89e3\uff0c\u95dc\u65bc django \u7684\u4e00\u4e9b\u57fa\u672c\u4ecb\u7d39\u53ef\u4ee5\u53c3\u8003 [Django] \u7528 Python \u5beb\u7db2\u9801\uff1f\" \/>\n<meta property=\"og:url\" content=\"https:\/\/myoceane.fr\/index.php\/django-synchronousonlyoperation\/\" \/>\n<meta property=\"og:site_name\" content=\"\u60f3\u65b9\u6d89\u6cd5 - \u91cf\u74f6\u5916\u7684\u5929\u7a7a M-Y-Oceane\" \/>\n<meta property=\"article:published_time\" content=\"2021-12-05T01:44:12+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2021-12-05T01:56:02+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/myoceane.fr\/wp-content\/uploads\/2021\/12\/python-django-logo.jpeg\" \/>\n\t<meta property=\"og:image:width\" content=\"1280\" \/>\n\t<meta property=\"og:image:height\" content=\"720\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"\u6ab8\u6aac\u7238\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"\u6ab8\u6aac\u7238\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"1 minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/myoceane.fr\/index.php\/django-synchronousonlyoperation\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/myoceane.fr\/index.php\/django-synchronousonlyoperation\/\"},\"author\":{\"name\":\"\u6ab8\u6aac\u7238\",\"@id\":\"https:\/\/myoceane.fr\/#\/schema\/person\/4a4552fb8c27693083d465e12db7658b\"},\"headline\":\"[Django] SynchronousOnlyOperation \u89e3\u6c7a\u65b9\u6cd5\",\"datePublished\":\"2021-12-05T01:44:12+00:00\",\"dateModified\":\"2021-12-05T01:56:02+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/myoceane.fr\/index.php\/django-synchronousonlyoperation\/\"},\"wordCount\":101,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/myoceane.fr\/#\/schema\/person\/4a4552fb8c27693083d465e12db7658b\"},\"image\":{\"@id\":\"https:\/\/myoceane.fr\/index.php\/django-synchronousonlyoperation\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/myoceane.fr\/wp-content\/uploads\/2021\/12\/python-django-logo.jpeg\",\"keywords\":[\"Django\",\"Python\",\"sync_to_async\",\"SynchronousOnlyOperation\"],\"articleSection\":[\"IT Technology\",\"Python\",\"Website\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/myoceane.fr\/index.php\/django-synchronousonlyoperation\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/myoceane.fr\/index.php\/django-synchronousonlyoperation\/\",\"url\":\"https:\/\/myoceane.fr\/index.php\/django-synchronousonlyoperation\/\",\"name\":\"[Django] SynchronousOnlyOperation \u89e3\u6c7a\u65b9\u6cd5 - \u60f3\u65b9\u6d89\u6cd5 - \u91cf\u74f6\u5916\u7684\u5929\u7a7a M-Y-Oceane\",\"isPartOf\":{\"@id\":\"https:\/\/myoceane.fr\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/myoceane.fr\/index.php\/django-synchronousonlyoperation\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/myoceane.fr\/index.php\/django-synchronousonlyoperation\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/myoceane.fr\/wp-content\/uploads\/2021\/12\/python-django-logo.jpeg\",\"datePublished\":\"2021-12-05T01:44:12+00:00\",\"dateModified\":\"2021-12-05T01:56:02+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/myoceane.fr\/index.php\/django-synchronousonlyoperation\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/myoceane.fr\/index.php\/django-synchronousonlyoperation\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/myoceane.fr\/index.php\/django-synchronousonlyoperation\/#primaryimage\",\"url\":\"https:\/\/myoceane.fr\/wp-content\/uploads\/2021\/12\/python-django-logo.jpeg\",\"contentUrl\":\"https:\/\/myoceane.fr\/wp-content\/uploads\/2021\/12\/python-django-logo.jpeg\",\"width\":1280,\"height\":720},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/myoceane.fr\/index.php\/django-synchronousonlyoperation\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/myoceane.fr\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"[Django] SynchronousOnlyOperation \u89e3\u6c7a\u65b9\u6cd5\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/myoceane.fr\/#website\",\"url\":\"https:\/\/myoceane.fr\/\",\"name\":\"M-Y-Oceane \u60f3\u65b9\u6d89\u6cd5\u3002\u91cf\u74f6\u5916\u7684\u5929\u7a7a\",\"description\":\"\u60f3\u65b9\u6d89\u6cd5, France, Taiwan, Health, Information Technology\",\"publisher\":{\"@id\":\"https:\/\/myoceane.fr\/#\/schema\/person\/4a4552fb8c27693083d465e12db7658b\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/myoceane.fr\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"https:\/\/myoceane.fr\/#\/schema\/person\/4a4552fb8c27693083d465e12db7658b\",\"name\":\"\u6ab8\u6aac\u7238\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/myoceane.fr\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/6cc678684664f8ad45a8d56a6630b183?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/6cc678684664f8ad45a8d56a6630b183?s=96&d=mm&r=g\",\"caption\":\"\u6ab8\u6aac\u7238\"},\"logo\":{\"@id\":\"https:\/\/myoceane.fr\/#\/schema\/person\/image\/\"},\"url\":\"https:\/\/myoceane.fr\/index.php\/author\/johnny5584767gmail-com\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"[Django] SynchronousOnlyOperation \u89e3\u6c7a\u65b9\u6cd5 - \u60f3\u65b9\u6d89\u6cd5 - \u91cf\u74f6\u5916\u7684\u5929\u7a7a M-Y-Oceane","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/myoceane.fr\/index.php\/django-synchronousonlyoperation\/","og_locale":"en_US","og_type":"article","og_title":"[Django] SynchronousOnlyOperation \u89e3\u6c7a\u65b9\u6cd5 - \u60f3\u65b9\u6d89\u6cd5 - \u91cf\u74f6\u5916\u7684\u5929\u7a7a M-Y-Oceane","og_description":"\u5728\u4f7f\u7528 Django Rest Framework \u958b\u767c\u7684\u6642\u5019\u51fa\u73fe SynchronousOnlyOperation \u7684\u932f\u8aa4\uff0c\u672c\u7bc7\u5c55\u793a\u4e00\u500b\u7bc4\u4f8b\u7d00\u9304\u7b46\u8005\u4f7f\u7528 sync_to_async \u7684\u89e3\u6c7a\u65b9\u6cd5\uff0c\u4e00\u958b\u59cb\u770b sync_to_async \u8aaa\u660e\u7684\u6642\u5019\u4e26\u4e0d\u597d\u7406\u89e3\u8981\u600e\u9ebc\u4f7f\u7528\uff0c\u53c3\u8003\u7bc4\u4f8b\u53ef\u4ee5\u6bd4\u8f03\u5bb9\u6613\u4e86\u89e3\uff0c\u95dc\u65bc django \u7684\u4e00\u4e9b\u57fa\u672c\u4ecb\u7d39\u53ef\u4ee5\u53c3\u8003 [Django] \u7528 Python \u5beb\u7db2\u9801\uff1f","og_url":"https:\/\/myoceane.fr\/index.php\/django-synchronousonlyoperation\/","og_site_name":"\u60f3\u65b9\u6d89\u6cd5 - \u91cf\u74f6\u5916\u7684\u5929\u7a7a M-Y-Oceane","article_published_time":"2021-12-05T01:44:12+00:00","article_modified_time":"2021-12-05T01:56:02+00:00","og_image":[{"width":1280,"height":720,"url":"https:\/\/myoceane.fr\/wp-content\/uploads\/2021\/12\/python-django-logo.jpeg","type":"image\/jpeg"}],"author":"\u6ab8\u6aac\u7238","twitter_card":"summary_large_image","twitter_misc":{"Written by":"\u6ab8\u6aac\u7238","Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/myoceane.fr\/index.php\/django-synchronousonlyoperation\/#article","isPartOf":{"@id":"https:\/\/myoceane.fr\/index.php\/django-synchronousonlyoperation\/"},"author":{"name":"\u6ab8\u6aac\u7238","@id":"https:\/\/myoceane.fr\/#\/schema\/person\/4a4552fb8c27693083d465e12db7658b"},"headline":"[Django] SynchronousOnlyOperation \u89e3\u6c7a\u65b9\u6cd5","datePublished":"2021-12-05T01:44:12+00:00","dateModified":"2021-12-05T01:56:02+00:00","mainEntityOfPage":{"@id":"https:\/\/myoceane.fr\/index.php\/django-synchronousonlyoperation\/"},"wordCount":101,"commentCount":0,"publisher":{"@id":"https:\/\/myoceane.fr\/#\/schema\/person\/4a4552fb8c27693083d465e12db7658b"},"image":{"@id":"https:\/\/myoceane.fr\/index.php\/django-synchronousonlyoperation\/#primaryimage"},"thumbnailUrl":"https:\/\/myoceane.fr\/wp-content\/uploads\/2021\/12\/python-django-logo.jpeg","keywords":["Django","Python","sync_to_async","SynchronousOnlyOperation"],"articleSection":["IT Technology","Python","Website"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/myoceane.fr\/index.php\/django-synchronousonlyoperation\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/myoceane.fr\/index.php\/django-synchronousonlyoperation\/","url":"https:\/\/myoceane.fr\/index.php\/django-synchronousonlyoperation\/","name":"[Django] SynchronousOnlyOperation \u89e3\u6c7a\u65b9\u6cd5 - \u60f3\u65b9\u6d89\u6cd5 - \u91cf\u74f6\u5916\u7684\u5929\u7a7a M-Y-Oceane","isPartOf":{"@id":"https:\/\/myoceane.fr\/#website"},"primaryImageOfPage":{"@id":"https:\/\/myoceane.fr\/index.php\/django-synchronousonlyoperation\/#primaryimage"},"image":{"@id":"https:\/\/myoceane.fr\/index.php\/django-synchronousonlyoperation\/#primaryimage"},"thumbnailUrl":"https:\/\/myoceane.fr\/wp-content\/uploads\/2021\/12\/python-django-logo.jpeg","datePublished":"2021-12-05T01:44:12+00:00","dateModified":"2021-12-05T01:56:02+00:00","breadcrumb":{"@id":"https:\/\/myoceane.fr\/index.php\/django-synchronousonlyoperation\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/myoceane.fr\/index.php\/django-synchronousonlyoperation\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/myoceane.fr\/index.php\/django-synchronousonlyoperation\/#primaryimage","url":"https:\/\/myoceane.fr\/wp-content\/uploads\/2021\/12\/python-django-logo.jpeg","contentUrl":"https:\/\/myoceane.fr\/wp-content\/uploads\/2021\/12\/python-django-logo.jpeg","width":1280,"height":720},{"@type":"BreadcrumbList","@id":"https:\/\/myoceane.fr\/index.php\/django-synchronousonlyoperation\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/myoceane.fr\/"},{"@type":"ListItem","position":2,"name":"[Django] SynchronousOnlyOperation \u89e3\u6c7a\u65b9\u6cd5"}]},{"@type":"WebSite","@id":"https:\/\/myoceane.fr\/#website","url":"https:\/\/myoceane.fr\/","name":"M-Y-Oceane \u60f3\u65b9\u6d89\u6cd5\u3002\u91cf\u74f6\u5916\u7684\u5929\u7a7a","description":"\u60f3\u65b9\u6d89\u6cd5, France, Taiwan, Health, Information Technology","publisher":{"@id":"https:\/\/myoceane.fr\/#\/schema\/person\/4a4552fb8c27693083d465e12db7658b"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/myoceane.fr\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":["Person","Organization"],"@id":"https:\/\/myoceane.fr\/#\/schema\/person\/4a4552fb8c27693083d465e12db7658b","name":"\u6ab8\u6aac\u7238","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/myoceane.fr\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/6cc678684664f8ad45a8d56a6630b183?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/6cc678684664f8ad45a8d56a6630b183?s=96&d=mm&r=g","caption":"\u6ab8\u6aac\u7238"},"logo":{"@id":"https:\/\/myoceane.fr\/#\/schema\/person\/image\/"},"url":"https:\/\/myoceane.fr\/index.php\/author\/johnny5584767gmail-com\/"}]}},"amp_enabled":false,"_links":{"self":[{"href":"https:\/\/myoceane.fr\/index.php\/wp-json\/wp\/v2\/posts\/8297","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/myoceane.fr\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/myoceane.fr\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/myoceane.fr\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/myoceane.fr\/index.php\/wp-json\/wp\/v2\/comments?post=8297"}],"version-history":[{"count":8,"href":"https:\/\/myoceane.fr\/index.php\/wp-json\/wp\/v2\/posts\/8297\/revisions"}],"predecessor-version":[{"id":8316,"href":"https:\/\/myoceane.fr\/index.php\/wp-json\/wp\/v2\/posts\/8297\/revisions\/8316"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/myoceane.fr\/index.php\/wp-json\/wp\/v2\/media\/8308"}],"wp:attachment":[{"href":"https:\/\/myoceane.fr\/index.php\/wp-json\/wp\/v2\/media?parent=8297"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/myoceane.fr\/index.php\/wp-json\/wp\/v2\/categories?post=8297"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/myoceane.fr\/index.php\/wp-json\/wp\/v2\/tags?post=8297"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}