core.mail.EmailMessage

class EmailMessage [source] The EmailMessage class is initialized with the following parameters (in the given order, if positional arguments are used). All parameters are optional and can be set at any time prior to calling the send() method. subject: The subject line of the email. body: The body text. This should be a plain text message. from_email: The sender’s address. Both fred@example.com and Fred <fred@example.com> forms are legal. If omitted, the DEFAULT_FROM_EMAIL setting is

core.files.uploadhandler.FileUploadHandler.new_file()

FileUploadHandler.new_file(field_name, file_name, content_type, content_length, charset, content_type_extra) [source] Callback signaling that a new file upload is starting. This is called before any data has been fed to any upload handlers. field_name is a string name of the file <input> field. file_name is the unicode filename that was provided by the browser. content_type is the MIME type provided by the browser – E.g. 'image/jpeg'. content_length is the length of the image given by

core.files.uploadhandler.FileUploadHandler.upload_complete()

FileUploadHandler.upload_complete() [source] Callback signaling that the entire upload (all files) has completed.

core.files.uploadhandler.FileUploadHandler.receive_data_chunk()

FileUploadHandler.receive_data_chunk(raw_data, start) [source] Receives a “chunk” of data from the file upload. raw_data is a byte string containing the uploaded data. start is the position in the file where this raw_data chunk begins. The data you return will get fed into the subsequent upload handlers’ receive_data_chunk methods. In this way, one handler can be a “filter” for other handlers. Return None from receive_data_chunk to short-circuit remaining upload handlers from getting this ch

core.files.uploadhandler.FileUploadHandler.handle_raw_input()

FileUploadHandler.handle_raw_input(input_data, META, content_length, boundary, encoding) [source] Allows the handler to completely override the parsing of the raw HTTP input. input_data is a file-like object that supports read()-ing. META is the same object as request.META. content_length is the length of the data in input_data. Don’t read more than content_length bytes from input_data. boundary is the MIME boundary for this request. encoding is the encoding of the request. Return None if yo

core.files.uploadhandler.FileUploadHandler.chunk_size

FileUploadHandler.chunk_size Size, in bytes, of the “chunks” Django should store into memory and feed into the handler. That is, this attribute controls the size of chunks fed into FileUploadHandler.receive_data_chunk. For maximum performance the chunk sizes should be divisible by 4 and should not exceed 2 GB (231 bytes) in size. When there are multiple chunk sizes provided by multiple handlers, Django will use the smallest chunk size defined by any handler. The default is 64*210 bytes, or 6

core.files.uploadhandler.FileUploadHandler.file_complete()

FileUploadHandler.file_complete(file_size) [source] Called when a file has finished uploading. The handler should return an UploadedFile object that will be stored in request.FILES. Handlers may also return None to indicate that the UploadedFile object should come from subsequent upload handlers.

core.files.uploadedfile.UploadedFile.name

UploadedFile.name The name of the uploaded file (e.g. my_file.txt).

core.files.uploadedfile.UploadedFile.size

UploadedFile.size The size, in bytes, of the uploaded file.

core.files.uploadedfile.UploadedFile.read()

UploadedFile.read() Read the entire uploaded data from the file. Be careful with this method: if the uploaded file is huge it can overwhelm your system if you try to read it into memory. You’ll probably want to use chunks() instead; see below.