
Security News
Deno 2.4 Brings Back deno bundle, Improves Dependency Management and Observability
Deno 2.4 brings back bundling, improves dependency updates and telemetry, and makes the runtime more practical for real-world JavaScript projects.
django-gmailapi-json-backend
Advanced tools
Email backend for Django which sends email via the Gmail API through a JSON credential
Email backend for Django which sends email via the Gmail API through a JSON credential
The simple SMTP protocol is disabled by default for Gmail users, since this is included in the Less Secure Apps (LSA) category. This package implements the Gmail API directly with a JSON Google service account as a Django email backend and can be used with 'django-mailer'.
Python 3.9+
The package is available through pip. To easily install or upgrade it, do
pip install --upgrade django-gmailapi-json-backend
In your settings.py
:
INSTALLED_APPS = [
...
'gmailapi_backend',
...
]
EMAIL_FROM = 'Company<your-email@domain.com>'
GMAIL_USER = 'your-email@domain.com'
EMAIL_BACKEND = "gmailapi_backend.service.GmailApiBackend"
GMAIL_SCOPES = ['https://www.googleapis.com/auth/gmail.send']
GOOGLE_SERVICE_ACCOUNT = '{
"type": "service_account",
"project_id": "your-project",
"private_key_id":
...
}'
If you use django-mailer as email backend you can send through gmail API as follow:
EMAIL_BACKEND = "mailer.backend.DbBackend"
MAILER_EMAIL_BACKEND = "gmailapi_backend.service.GmailApiBackend"
Use the native EmailMessage
class in Django. Just a sample:
message = render_to_string('email/ordine_pagato.html', {
'ordine': ordine,
})
mail_subject = _('This is just a sample')
email = EmailMessage(
mail_subject, message, settings.EMAIL_FROM, to=['recipient@domain.com']
)
email.content_subtype = "html"
email.attach(sample_file.file.name, sample_file.file.read(), 'application/pdf')
email.send()
FAQs
Email backend for Django which sends email via the Gmail API through a JSON credential
We found that django-gmailapi-json-backend demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Deno 2.4 brings back bundling, improves dependency updates and telemetry, and makes the runtime more practical for real-world JavaScript projects.
Security News
CVEForecast.org uses machine learning to project a record-breaking surge in vulnerability disclosures in 2025.
Security News
Browserslist-rs now uses static data to reduce binary size by over 1MB, improving memory use and performance for Rust-based frontend tools.