{"id":6011,"date":"2020-12-21T23:40:38","date_gmt":"2020-12-21T14:40:38","guid":{"rendered":"http:\/\/blog.jansnap.com\/?p=6011"},"modified":"2021-12-19T20:34:04","modified_gmt":"2021-12-19T11:34:04","slug":"django-allauth%e3%81%a7%e3%80%81%e6%97%a2%e5%ad%98%e3%81%ae%e3%83%97%e3%83%ac%e3%83%bc%e3%82%b9%e3%83%9b%e3%83%ab%e3%83%80%e3%83%bc%e3%82%84%e3%83%a9%e3%83%99%e3%83%ab%e3%82%92%e5%a4%89%e6%9b%b4%e3%81","status":"publish","type":"post","link":"https:\/\/blog.jansnap.com\/?p=6011","title":{"rendered":"django-allauth\u3067\u3001\u65e2\u5b58\u306e\u30d7\u30ec\u30fc\u30b9\u30db\u30eb\u30c0\u30fc\u3084\u30e9\u30d9\u30eb\u3092\u5909\u66f4\u3059\u308b"},"content":{"rendered":"\n<h2><span class=\"ez-toc-section\" id=\"%E6%A6%82%E8%A6%81\"><\/span>\n\u6982\u8981<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n<ul>\n<li>django-allauth\u3067\u3001\u81ea\u4f5c\u306e\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8\u3092\u4f5c\u308b\u969b\u306b\u65e2\u5b58\u306elabel\u3084placeholder\u304c\u82f1\u8a9e\u306a\u306e\u3067\u65e5\u672c\u8a9e\u306b\u66f8\u304d\u63db\u3048\u305f\u3044<\/li>\n<li>\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8\u3067\u30d5\u30a3\u30fc\u30eb\u30c9\u3092\u51fa\u529b\u3059\u308b\u969b\u306f\u3001\u76f4\u66f8\u304d\u305b\u305a\u306bfor\u6587\u3067\u56de\u3057\u3066\u53d6\u5f97\u3057\u3066\u3044\u308b\u5834\u5408\u3092\u60f3\u5b9a<\/li>\n<\/ul>\n\n<h2><span class=\"ez-toc-section\" id=\"%E5%AF%BE%E5%BF%9C\"><\/span>\n\u5bfe\u5fdc<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n<ul>\n<li>form\u30af\u30e9\u30b9\u306e<code>__init__<\/code>\u3067\u3001<code>self.field<\/code>\u306e\u8f9e\u66f8\u3092\u4e0a\u66f8\u304d\u3059\u308b<\/li>\n<\/ul>\n\n<h2><span class=\"ez-toc-section\" id=\"%E3%82%BD%E3%83%BC%E3%82%B9%E3%82%B3%E3%83%BC%E3%83%89\"><\/span>\n\u30bd\u30fc\u30b9\u30b3\u30fc\u30c9<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n<h3><span class=\"ez-toc-section\" id=\"formspy\"><\/span>\nforms.py<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"python\" class=\"language-python\">from allauth.account.forms import SignupForm\n\nclass MyBaseUserSignupForm(SignupForm):\n    def __init__(self, *args, **kwargs):\n        super(MyBaseUserSignupForm, self).__init__(*args, **kwargs)\n        # django-allauth\u306e\u30d5\u30a3\u30fc\u30eb\u30c9\u3092\u4e0a\u66f8\u304d\n        self.fields['email'].label = '\u30e1\u30fc\u30eb\u30a2\u30c9\u30ec\u30b9'\n        self.fields['email'].widget.attrs['placeholder'] = '\u30e1\u30fc\u30eb\u30a2\u30c9\u30ec\u30b9'\n        self.fields['password1'].label = '\u30d1\u30b9\u30ef\u30fc\u30c9'\n        self.fields['password1'].widget.attrs['placeholder'] = '\u30d1\u30b9\u30ef\u30fc\u30c9'<\/code><\/pre>\n\n\n\n<h2><span class=\"ez-toc-section\" id=\"%E6%B3%A8%E6%84%8F\"><\/span>\n\u6ce8\u610f<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n<ul>\n<li>\u30d1\u30b9\u30ef\u30fc\u30c9\u6b04\u306f<code>password1<\/code>\u3067\u3001\u6570\u5b57\u304c\u4ed8\u304f(\u78ba\u8a8d\u7528\u30d1\u30b9\u30ef\u30fc\u30c9\u5165\u529b\u6b04\u3068\u533a\u5225\u3059\u308b\u305f\u3081)<\/li>\n<\/ul>\n\n<h2><span class=\"ez-toc-section\" id=\"%E5%8F%82%E8%80%83\"><\/span>\n\u53c2\u8003<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n<ul>\n<li><a href=\"https:\/\/qiita.com\/nakkun\/items\/271998ccce976d8b9c21\" id=\"reference-e5b51991c6fae325552d\">Django\u3067\u5165\u529b\u30d5\u30a3\u30fc\u30eb\u30c9\u306b\u30d7\u30ec\u30fc\u30b9\u30db\u30eb\u30c0(placeholder)\u3092\u8a2d\u5b9a\u3059\u308b<\/a><\/li>\n<li><p><a href=\"https:\/\/stackoverflow.com\/questions\/33650657\/how-do-i-remove-a-placeholder-on-an-emailfield-in-django\" rel=\"nofollow noopener\" target=\"_blank\">How do I remove a placeholder on an EmailField in Django?<\/a><\/p><\/li>\n<li><p><a href=\"https:\/\/stackoverflow.com\/questions\/4101258\/how-do-i-add-a-placeholder-on-a-charfield-in-django\" rel=\"nofollow noopener\" target=\"_blank\">How do I add a placeholder on a CharField in Django?<\/a><\/p><\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<ul>\n<li>django-allauth\u3067\u3001\u81ea\u4f5c\u306e\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8\u3092\u4f5c\u308b\u969b\u306b\u65e2\u5b58\u306elabel\u3084placeholder\u304c\u82f1\u8a9e\u306a\u306e\u3067\u65e5\u672c\u8a9e\u306b\u66f8\u304d\u63db\u3048\u305f\u3044<\/li>\n<li>\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8\u3067\u30d5\u30a3\u30fc\u30eb\u30c9\u3092\u51fa\u529b\u3059\u308b\u969b\u306f\u3001\u76f4\u66f8\u304d\u305b\u305a\u306bfor\u6587\u3067\u56de\u3057\u3066\u53d6\u5f97\u3057\u3066\u3044\u308b\u5834\u5408\u3092\u60f3\u5b9a<\/li>\n<\/ul>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4106,4107,4108,4070],"tags":[4103,4104,4105],"class_list":["post-6011","post","type-post","status-publish","format-standard","hentry","category-django","category-django-allauth","category-django30","category-python","tag-django","tag-django-allauth","tag-django30"],"_links":{"self":[{"href":"https:\/\/blog.jansnap.com\/index.php?rest_route=\/wp\/v2\/posts\/6011","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.jansnap.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.jansnap.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.jansnap.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.jansnap.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=6011"}],"version-history":[{"count":1,"href":"https:\/\/blog.jansnap.com\/index.php?rest_route=\/wp\/v2\/posts\/6011\/revisions"}],"predecessor-version":[{"id":6371,"href":"https:\/\/blog.jansnap.com\/index.php?rest_route=\/wp\/v2\/posts\/6011\/revisions\/6371"}],"wp:attachment":[{"href":"https:\/\/blog.jansnap.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=6011"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.jansnap.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=6011"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.jansnap.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=6011"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}