per page, with , order by , clip by
Results of 1 - 10 of about 62 for connection (0.005 sec.)
メールを送信する 13192
メールを送信する Django provides wrappers for Python's email and smtplib modules to simplify composing and sending email. Django's email framework also supports swapping in different delivery mechanisms: you can direct email to the console ... } This defines three mailer configurations: "default" sends through an SMTP server at smtp.example.net with a TLS secured connection. It reads an account id and API key from environment variables and uses them as the SMTP authentication username and passw ... ( subject , message , from_email , recipient_list , * , fail_silently = False , auth_user = None , auth_password = None , connection = None , html_message = None ) [ソース] django.core.mail.send_mail() sends a single email message. subject 、 message 、 f ... SMTP サーバー認証のためのパスワードで、省略可能。指定されなかった場合、Django は EMAIL_HOST_PASSWORD 設定の値を使います。 connection : メール送信のために使うバックエンドで、省略可能。指定しなかった場合、デフォルトのバックエンドのインスタンスが使われます。 ...
https://man.mtool.work/django/6.1/topics/email.html
Migrating email to mailers 12932
Migrating email to mailers Django 6.1 introduced the MAILERS setting, replacing EMAIL_BACKEND and several other EMAIL_* settings. It also introduced mail.mailers for obtaining configured email backend instances, replacing mail.get_connection ... n() . A new using argument replaces the earlier connection in Django functions that send email. This guide provides details on migrating existing projects to the new mailers functio ... s. Other updates are needed only for projects or reusable Django libraries that use these specific features: Replacing get_connection() and connection arguments Replacing fail_silently Migrating custom email backends Replacing auth_user and auth_password U ... L_HOST_USER , EMAIL_PORT , EMAIL_SSL_CERTFILE , EMAIL_SSL_KEYFILE , EMAIL_TIMEOUT , EMAIL_USE_SSL , EMAIL_USE_TLS mail.get_connection() and the connection arguments to mail functions The fail_silently argument to send_mail() , send_mass_mail() , mail_admin ...
https://man.mtool.work/django/6.1/howto/mailers-migration.html
Porting your apps from Django 0.96 to 1.0 11704
Porting your apps from Django 0.96 to 1.0 Django 1.0 breaks compatibility with 0.96 in some areas. This guide will help you port 0.96 projects and apps to 1.0. The first part of this document includes the common changes needed to run with 1 ... code if you're using any of these functions, all of which are in django.db : Old (0.96) New (1.0) backend.get_autoinc_sql connection.ops.autoinc_sql backend.get_date_extract_sql connection.ops.date_extract_sql backend.get_date_trunc_sql connection.ops.dat ... e_trunc_sql backend.get_datetime_cast_sql connection.ops.datetime_cast_sql backend.get_deferrable_sql connection.ops.deferrable_sql backend.get_drop_foreignkey_sql connection. ... ops.drop_foreignkey_sql backend.get_fulltext_search_sql connection.ops.fulltext_search_sql backend.get_last_insert_id connection.ops.last_insert_id backend.get_limit_offset_sql connection.o ...
https://man.mtool.work/django/6.1/releases/1.0-porting-guide.html
Django 1.2 リリースノート 11097
Django 1.2 リリースノート 2010 年 5 月 17 日 Django 1.2 へようこそ! Nearly a year in the making, Django 1.2 packs an impressive list of new features and lots of bug fixes. These release notes cover the new features, as well as important cha ... ions. オーバービュー Django 1.2 introduces several large, important new features, including: Support for multiple database connections in a single Django instance. Model validation inspired by Django's form validation. Vastly improved protection against Cr ... prototype, and two extra methods have been introduced: class CustomModelField ( models . Field ): ... def db_type ( self , connection ): ... def get_prep_value ( self , value ): ... def get_prep_lookup ( self , lookup_type , value ): ... def get_db_prep_sa ... ve ( self , value , connection ): ... def get_db_prep_value ( self , value , connection , prepared = False ): ... def get_db_prep_lookup ( self , lookup_ ...
https://man.mtool.work/django/6.1/releases/1.2.html
Django 6.1 release notes 8900
Django 6.1 release notes August 5, 2026 Welcome to Django 6.1! These release notes cover the new features , as well as some backwards incompatible changes you'll want to be aware of when upgrading from Django 6.0 or earlier. We've begun the ... ion, mail.mailers["default"] works with either MAILERS or the deprecated EMAIL_BACKEND setting defined. The deprecated get_connection() function will also return an instance of the default mailer when MAILERS is defined. Adopting calendar versioning Follow ... fail_silently=True , auth_user , or auth_password to mail sending functions (such as send_mail() ) while also providing a connection now raises a TypeError . The undocumented EmailMessage.get_connection() method is no longer used. Defining it in a subclas ... s or trying to call it now causes an error. EmailMessage.send() no longer sets the connection property on the EmailMessage . (This behavior was never documented. The send() method will still use a connection that is ...
https://man.mtool.work/django/6.1/releases/6.1.html
データベースの計測 8539
データベースの計測 コードから発行されたクエリを理解して制御するために、Django は、データベースクエリの実行周辺にラッパー関数をインストールするためのフックを提供しています。たとえば、ラッパーは、クエリのカウント、クエリの実行時間の測定、クエ ... s allowed here." ) そして、テンプレートからのクエリをブロックするには、ビューでこのように使用します: from django.db import connection from django.shortcuts import render def my_view ( request ): context = { ... } # Code to generate context with all data. t ... emplate_name = ... with connection . execute_wrapper ( blocker ): return render ( request , template_name , context ) ラッパーに送られるパラメーターは以下の通 ... ッセージにコネクション名を含めることができます。 def blocker ( execute , sql , params , many , context ): alias = context [ "connection" ] . alias raise Exception ( "Access to database ' {} ' blocked here" . format ( alias )) より完全な例として、クエリロガー ...
https://man.mtool.work/django/6.1/topics/db/instrumentation.html
非同期サポート 8178
非同期サポート Django has support for writing asynchronous ("async") views, along with an entirely async-enabled request stack if you are running under ASGI . Async views will still work under WSGI, but with a small per-request adaptation c ... は、そのコードを1つの同期的な関数として書いて、 sync_to_async() を使用して呼び出すことをおすすめします。 Persistent database connections , set via the CONN_MAX_AGE setting, should also be disabled in async mode. Instead, use your database backend's built-in ... connection pooling if available, or investigate a third-party connection pooling option if required. As in synchronous Django, concurrent requests in a single process share that pool, so size it ... request gets its own per-context worker, so concurrent requests do not serialize against each other. This mirrors Django's connection-per-thread model, and the same constraint applies in other async database libraries, where concurrent queries on a single ...
https://man.mtool.work/django/6.1/topics/async.html
カスタムのルックアップを書く 8077
カスタムのルックアップを書く Django には (たとえば exact や icontains などの) フィルタリングを行う 組み込みのルックアップ がたくさんあります。このドキュメントでは、カスタムルックアップを作る方法や、既存のルックアップの動作を変更する方法につ ... あります。 from django.db.models import Lookup class NotEqual ( Lookup ): lookup_name = "ne" def as_sql ( self , compiler , connection ): lhs , lhs_params = self . process_lhs ( compiler , connection ) rhs , rhs_params = self . process_rhs ( compiler , conn ... です。 We then need to define the as_sql method. This takes a SQLCompiler object, called compiler , and the active database connection. SQLCompiler objects are not documented, but the only thing we need to know about them is that they have a compile() metho ... m django.db.models import Lookup class AbsoluteValueLessThan ( Lookup ): lookup_name = "lt" def as_sql ( self , compiler , connection ): lhs , lhs_params = compiler . compile ( self . lhs . lhs ) rhs , rhs_params = self . process_rhs ( compiler , connectio ...
https://man.mtool.work/django/6.1/howto/custom-lookups.html
カスタムのモデルフィールドを作成する 7817
カスタムのモデルフィールドを作成する はじめに モデルリファレンス ドキュメントでは、Djangoの標準フィールドクラスである、 CharField や、 DateField などの使い方を説明しています。多くの場合、これらのクラスがあれば十分です。ただし、Djangoのバージ ... () 関数を以下のように実装できます: from django.db import models class MytypeField ( models . Field ): def db_type ( self , connection ): return "mytype" MytypeField を取得したら、他の Field タイプと同様に、どのモデルでも使用できます: class Person ( models ... 刻のカラムの型は timestamp と呼ばれますが、同じカラムが MySQL では datetime と呼ばれます。この違いは db_type() メソッド内で connection.vendor 属性をチェックすることでハンドリングできます。現在のビルトインされているベンダー名は、 sqlite 、 postgresql 、 mysq ... l 、 oracle です。 例えば: class MyDateField ( models . Field ): def db_type ( self , connection ): if connection . vendor == "mysql" : return "datetime" else : return "timestamp" Django は、アプリケーションのために CRE ...
https://man.mtool.work/django/6.1/howto/custom-model-fields.html
FAQ: データベースとモデル 7773
FAQ: データベースとモデル Django が実行している生の SQL クエリを見られますか? Django の設定ファイルの DEBUG が True になっていることを確認します。次に、以下のコードを実行してください。 >>> from django.db import connection >>> connection . q ... ueries [{'sql': 'SELECT polls_polls.id, polls_polls.question, polls_polls.pub_date FROM polls_polls', 'time': '0.002'}] connection.queries は DEBUG が True の場合にのみ利用できます。これはクエリの実行順に辞書を並べたリストです。各辞書には以下の項目が入っ ... ています: sql - 素のSQL構文 time - ステートメントの実行に要した秒数。 connection.queries にはINSERT, UPDATE, SELECTなどの全てのSQL文が記録されています。アプリケーションがデータベースを操作するたびに、クエ ... リが記録されていきます。 もし 複数のデータベース を利用している場合、 connections の辞書の各要素に対して、同じコードを実行できます: >>> from django.db import connections >>> connections [ "my_db_alias" ] ...
https://man.mtool.work/django/6.1/faq/models.html
PREV 1 2 3 4 5 6 7 NEXT