Metadata-Version: 2.4
Name: django-o365
Version: 0.3.0
Summary: EmailBackend for Django to work with Microsoft Exchange Online, via o365 package
Author-email: Robert Gutschale <r.gutschale@blueshoe.de>
License-Expression: MIT
Project-URL: Homepage, https://github.com/Blueshoe/django-o365
Project-URL: Repository, https://github.com/Blueshoe/django-o365
Keywords: django,Outlook,Microsoft,Exchange,Blueshoe,O365
Classifier: Development Status :: 4 - Beta
Classifier: Environment :: Web Environment
Classifier: Framework :: Django
Classifier: Intended Audience :: Developers
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Topic :: Internet :: WWW/HTTP
Classifier: Topic :: Internet :: WWW/HTTP :: Dynamic Content
Classifier: Topic :: Software Development :: Libraries :: Application Frameworks
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: django~=4.2.27
Requires-Dist: o365~=2.1.8
Dynamic: license-file

[![Tests Status](./reports/junit/tests-badge.svg?dummy=8484744)](./reports/junit/report.html)
[![Coverage Status](./reports/coverage/coverage-badge.svg?dummy=8484744)](./reports/coverage/htmlcov/index.html)
# django-o365
Simple EmailBackend for Django to work with Microsoft Exchange Online, via o365 package.

## Development
Install [uv](https://docs.astral.sh/uv/), then create the environment and run the checks:
```bash
uv sync --dev
uv run ruff format --check .
uv run ruff check .
uv run pytest tests/
```

## Supported authentication
Currently only OAuth2.0 authentication with `credentials` workflow is supported.

## Configuration
Following Django settings need to be added:
```python
EMAIL_O365_TENANT_ID = "my-client"
EMAIL_O365_CLIENT_ID = "my-client-id"
EMAIL_O365_CLIENT_SECRET = "super-secret"
EMAIL_O365_SENDER = "mysender@example.com"

# set backend
EMAIL_BACKEND = "django_o365.backend.O365EmailBackend"
```

## Badges
Badges have been created with [genbadge](https://github.com/smarie/python-genbadge):
```bash
# pytest
pytest --junitxml=reports/junit/junit.xml --html=reports/junit/report.html
genbadge tests

# coverage
coverage run -m pytest tests/
coverage xml
coverage html
genbadge coverage
```
