# django-gmail-oauth-backend
Simplifies Gmail authentication for Django applications using OAuth 2.0. WITHOUT App Passwords!
## Installation
```bash
pip install django-gmail-oauth-backend
```
Add settings to your Django project settings file.
```python
GMAIL_OAUTH_CLIENT_ID = 'YOUR_CLIENT_ID'
GMAIL_OAUTH_CLIENT_SECRET = 'YOUR_CLIENT_SECRET'
INSTALLED_APPS = [
...,
'gmail_oauth_backend',
...
]
```
And execute the following command at least once initially. This command will launch a web browser and request OAuth approval through the user’s browser. Once the request is completed, a Refresh Token for the Gmail API will be automatically issued. __Before running this init command, please make sure to add `http://localhost:8912/` to the redirect URLs in your Cloud Console settings.__
```bash
# Create RefreshToken table First
./manage.py migrate
# Then get the RefreshToken
./manage.py init_gmail_oauth_token
```
> Note: The Refresh Token is stored in the database and is used to automatically refresh the Access Token when it expires. The Google OAuth 2.0 refresh token typically **does not have an expiration date**, but if a refresh token becomes invalid or expires for other reasons, it will need to be reissued following the procedure above.
## Credits
- [django-gmailapi-backend](https://github.com/dolfim/django-gmailapi-backend)
## Authors & Contributors
- [Yeongbin Jo](iam.yeongbin.jo@gmail.com)
Raw data
{
"_id": null,
"home_page": "https://github.com/yeongbin-jo/django-gmail-oauth-backend",
"name": "django-gmail-oauth-backend",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.11",
"maintainer_email": null,
"keywords": null,
"author": "Yeongbin Jo",
"author_email": "iam.yeongbin.jo@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/70/5a/523408b69265fb8e4bc6887fb56fe721f4272bfa47c505cb47ab3a7e13ed/django_gmail_oauth_backend-0.2.0.tar.gz",
"platform": null,
"description": "# django-gmail-oauth-backend\n\nSimplifies Gmail authentication for Django applications using OAuth 2.0. WITHOUT App Passwords!\n\n## Installation\n\n```bash\npip install django-gmail-oauth-backend\n```\n\nAdd settings to your Django project settings file.\n\n```python\nGMAIL_OAUTH_CLIENT_ID = 'YOUR_CLIENT_ID'\nGMAIL_OAUTH_CLIENT_SECRET = 'YOUR_CLIENT_SECRET'\n\nINSTALLED_APPS = [\n ...,\n 'gmail_oauth_backend',\n ...\n]\n```\n\nAnd execute the following command at least once initially. This command will launch a web browser and request OAuth approval through the user\u2019s browser. Once the request is completed, a Refresh Token for the Gmail API will be automatically issued. __Before running this init command, please make sure to add `http://localhost:8912/` to the redirect URLs in your Cloud Console settings.__\n\n```bash\n# Create RefreshToken table First\n./manage.py migrate\n\n# Then get the RefreshToken\n./manage.py init_gmail_oauth_token\n```\n\n> Note: The Refresh Token is stored in the database and is used to automatically refresh the Access Token when it expires. The Google OAuth 2.0 refresh token typically **does not have an expiration date**, but if a refresh token becomes invalid or expires for other reasons, it will need to be reissued following the procedure above.\n\n## Credits\n\n- [django-gmailapi-backend](https://github.com/dolfim/django-gmailapi-backend)\n\n## Authors & Contributors\n\n- [Yeongbin Jo](iam.yeongbin.jo@gmail.com)\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "Simplifies Gmail authentication for Django applications using OAuth 2.0. WITHOUT App Passwords!",
"version": "0.2.0",
"project_urls": {
"Homepage": "https://github.com/yeongbin-jo/django-gmail-oauth-backend"
},
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "7f0fc21d859691b315e3af743ae5534febaf5fa3cc5683137c119b8face7300e",
"md5": "3b8ecc986d226d6916c0ad0c6c77c5c7",
"sha256": "6cad081c6e03e3c56fe35d3585df521a41ffb5a5b323f7cf2316f2206dbadde7"
},
"downloads": -1,
"filename": "django_gmail_oauth_backend-0.2.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "3b8ecc986d226d6916c0ad0c6c77c5c7",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.11",
"size": 8265,
"upload_time": "2024-09-11T04:25:09",
"upload_time_iso_8601": "2024-09-11T04:25:09.198348Z",
"url": "https://files.pythonhosted.org/packages/7f/0f/c21d859691b315e3af743ae5534febaf5fa3cc5683137c119b8face7300e/django_gmail_oauth_backend-0.2.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "705a523408b69265fb8e4bc6887fb56fe721f4272bfa47c505cb47ab3a7e13ed",
"md5": "45c68fa6cf2e2b52bcd7be9a97852b6b",
"sha256": "b9a06caa86e1bfc9d6c9c7509df919620a9bd390327bb599253c161b0def4909"
},
"downloads": -1,
"filename": "django_gmail_oauth_backend-0.2.0.tar.gz",
"has_sig": false,
"md5_digest": "45c68fa6cf2e2b52bcd7be9a97852b6b",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.11",
"size": 6531,
"upload_time": "2024-09-11T04:25:10",
"upload_time_iso_8601": "2024-09-11T04:25:10.637162Z",
"url": "https://files.pythonhosted.org/packages/70/5a/523408b69265fb8e4bc6887fb56fe721f4272bfa47c505cb47ab3a7e13ed/django_gmail_oauth_backend-0.2.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-09-11 04:25:10",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "yeongbin-jo",
"github_project": "django-gmail-oauth-backend",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"lcname": "django-gmail-oauth-backend"
}