... タフェースや Python API を使って管理できます。 フラットページは、URL、タイトル、コンテンツを持つオブジェクトです。これは、 "About" や "Privacy Policy" などのワンオフの特別なページに使用します。データベースに保存する必要はあるが、カスタムのDjangoアプリを ... し、それらの URL を URLconf にハードコードすることです。 from django.contrib.flatpages import views urlpatterns += [ path ( "about-us/" , views . flatpage , kwargs = { "url" : "/about-us/" }, name = "about" ), path ( "license/" , views . flatpage , kwar ... トページを表示したい場合は、 for 節を使用して認証済みユーザーを指定する必要があります。 例: {% get_flatpages for someuser as about_pages %} 匿名ユーザーを提供すると、 get_flatpages はユーザーを提供していない場合と同じように動作します。つまり、公開されて ... ... タフェースや Python API を使って管理できます。 フラットページは、URL、タイトル、コンテンツを持つオブジェクトです。これは、 "About" や "Privacy Policy" などのワンオフの特別なページに使用します。データベースに保存する必要はあるが、カスタムのDjangoアプリを ... し、それらの URL を URLconf にハードコードすることです。 from django.contrib.flatpages import views urlpatterns += [ path ( "about-us/" , views . flatpage , kwargs = { "url" : "/about-us/" }, name = "about" ), path ( "license/" , views . flatpage , kwar ... トページを表示したい場合は、 for 節を使用して認証済みユーザーを指定する必要があります。 例: {% get_flatpages for someuser as about_pages %} 匿名ユーザーを提供すると、 get_flatpages はユーザーを提供していない場合と同じように動作します。つまり、公開されて ... ... 出しに渡せばよいのです。 from django.urls import path from django.views.generic import TemplateView urlpatterns = [ path ( "about/" , TemplateView . as_view ( template_name = "about.html" )), ] as_view() に渡されたすべての引数は、クラスで設定された属性 ... ate_name などの属性や get_context_data などのメソッドをサブクラスで上書きする方法を紹介します。たとえば、1つのテンプレート about.html だけを表示するビューを作ることを考えてみてください。Django には、このために利用できるジェネリックビュー TemplateView ... 化し、テンプレート名を上書きすることで実装できます。 # some_app/views.py from django.views.generic import TemplateView class AboutView ( TemplateView ): template_name = "about.html" あとは、URLconf にこの新しいビューを追加する必要があります。 TemplateVi ... ... 出しに渡せばよいのです。 from django.urls import path from django.views.generic import TemplateView urlpatterns = [ path ( "about/" , TemplateView . as_view ( template_name = "about.html" )), ] as_view() に渡されたすべての引数は、クラスで設定された属性 ... ate_name などの属性や get_context_data などのメソッドをサブクラスで上書きする方法を紹介します。たとえば、1つのテンプレート about.html だけを表示するビューを作ることを考えてみてください。Django には、このために利用できるジェネリックビュー TemplateView ... 化し、テンプレート名を上書きすることで実装できます。 # some_app/views.py from django.views.generic import TemplateView class AboutView ( TemplateView ): template_name = "about.html" あとは、URLconf にこの新しいビューを追加する必要があります。 TemplateVi ... ... , we recommend referring to the official Python documentation , which provides comprehensive and authoritative information about the language, as well as links to other resources such as a list of books about Python . 前のトピックへ Django ドキュメント ... 次のトピックへ Django の概要 関連キーワード Django アプリ Python 全般 初心者 理解 about web 開発 正解 ドキュメント 行動 概要 クイック インストール ガイド チュートリアル 再利用 書き方 ステップ クイック検索 Last ... ... , we recommend referring to the official Python documentation , which provides comprehensive and authoritative information about the language, as well as links to other resources such as a list of books about Python . 前のトピックへ Django ドキュメント ... 次のトピックへ Django の概要 関連キーワード アプリ 全般 初心者 理解 about 開発 正解 ドキュメント 行動 概要 クイック ガイド チュートリアル 再利用 書き方 ステップ 貢献 参考 最小限 プログラミング プロ ... ... す。フレームワーク自体でも、もっと広いエコシステムでも、様々な方法で貢献できます。 Communication channels ¶ We're passionate about helping Django users make the jump to contributing members of the community. Communication is key - working on Django is b ... eing part of a conversation. Join it, to become familiar with what we're doing and how we talk about it. You'll be able to form relationships with more experienced contributors who are there to help guide you towards succes ... he Django Discord server to discuss and answer questions. By explaining Django to other users, you're going to learn a lot about the framework yourself. Django に関するブログを書いてください。私たちは知り得た Django のブログを全て community page 上にま ... ... す。フレームワーク自体でも、もっと広いエコシステムでも、様々な方法で貢献できます。 Communication channels ¶ We're passionate about helping Django users make the jump to contributing members of the community. Communication is key - working on Django is b ... eing part of a conversation. Join it, to become familiar with what we're doing and how we talk about it. You'll be able to form relationships with more experienced contributors who are there to help guide you towards succes ... he Django Discord server to discuss and answer questions. By explaining Django to other users, you're going to learn a lot about the framework yourself. Django に関するブログを書いてください。私たちは知り得た Django のブログを全て community page 上にま ... ... database itself contains constraints named in the old form; this will cause the database server to raise an error message about modifying nonexistent constraints. If you need to work around this, there are two methods available: Redirect the output o ... ases. We recommend that anyone new to form handling skip the old forms system and start with the new. For more information about django.newforms , read the newforms documentation . URLconf improvements ¶ You can now use any callable as the callback in ... one: dedicated views for adding and updating users have been added to the admin interface, so you no longer need to worry about working with hashed passwords in the admin. ありがとう ¶ Since 0.95, a number of people have stepped forward and taken a m ... ... database itself contains constraints named in the old form; this will cause the database server to raise an error message about modifying nonexistent constraints. If you need to work around this, there are two methods available: Redirect the output o ... ases. We recommend that anyone new to form handling skip the old forms system and start with the new. For more information about django.newforms , read the newforms documentation . URLconf improvements ¶ You can now use any callable as the callback in ... one: dedicated views for adding and updating users have been added to the admin interface, so you no longer need to worry about working with hashed passwords in the admin. ありがとう ¶ Since 0.95, a number of people have stepped forward and taken a m ... 2026年10月08日