vintasoftware / django-react-boilerplate

Django 5, React, Bootstrap 5 with Python 3 and Webpack project boilerplate
MIT License
1.94k stars 466 forks source link

issue #635: Add django-anymail #667

Closed vaishnavi-2901 closed 1 month ago

vaishnavi-2901 commented 2 months ago

Description

I added a depedencies and some base code to use django-anymail

Types of changes

Checklist:

Note:

Please update the config file for

  1. SENDGRID_API_KEY (this needs to be get via sendgrid)
  2. DEFAULT_FROM_EMAIL
vaishnavi-2901 commented 2 months ago

Okay

On Sat, 29 Jun 2024 at 00:51, Flávio Juvenal @.***> wrote:

@.**** commented on this pull request.

In backend/project_name/settings/base.py https://github.com/vintasoftware/django-react-boilerplate/pull/667#discussion_r1659217116 :

@@ -250,3 +251,16 @@ def base_dir_join(*args): DEFENDER_COOLOFF_TIME = 300 # 5 minutes DEFENDER_LOCKOUT_TEMPLATE = "defender/lockout.html" DEFENDER_REDIS_URL = config("REDIS_URL") + + + +# myproject/settings.py + +# Email Backend Configuration +EMAIL_BACKEND = "anymail.backends.sendgrid.EmailBackend" # or another supported backend +ANYMAIL = {

  • "SENDGRID_API_KEY": config("SENDGRID_API_KEY"), # Replace with your actual API key
  • can add other sendgrid fields here

    +}

  • +DEFAULT_FROM_EMAIL = config("DEFAULT_FROM_EMAIL") # Replace with your default from email

Instead of changing base.py to use sendgrid, please change production.py.

— Reply to this email directly, view it on GitHub https://github.com/vintasoftware/django-react-boilerplate/pull/667#pullrequestreview-2148800121, or unsubscribe https://github.com/notifications/unsubscribe-auth/AIZPCI5MKESTC7C7QE4YOHLZJWZT3AVCNFSM6AAAAABKBKOYZGVHI2DSMVQWIX3LMV43YUDVNRWFEZLROVSXG5CSMV3GSZLXHMZDCNBYHAYDAMJSGE . You are receiving this because you authored the thread.Message ID: @.*** com>

vaishnavi-2901 commented 2 months ago

For that, I need ENV file

On Sat, 29 Jun 2024 at 00:51, Flávio Juvenal @.***> wrote:

@.**** requested changes on this pull request.

Thanks for the PR. Please check comments. Also, please test on production to ensure it's working properly.

— Reply to this email directly, view it on GitHub https://github.com/vintasoftware/django-react-boilerplate/pull/667#pullrequestreview-2148801214, or unsubscribe https://github.com/notifications/unsubscribe-auth/AIZPCIYHPSKLPVGVYTCHASTZJWZVJAVCNFSM6AAAAABKBKOYZGVHI2DSMVQWIX3LMV43YUDVNRWFEZLROVSXG5CSMV3GSZLXHMZDCNBYHAYDCMRRGQ . You are receiving this because you authored the thread.Message ID: @.*** com>

fjsj commented 2 months ago

You'll follow the README to produce your own env to test.

vaishnavi-2901 commented 2 months ago

Oh, that I did already I thought we need to test with real creds.

Will move it to production.py

On Sat, 29 Jun 2024 at 01:02, Flávio Juvenal @.***> wrote:

You'll follow the README to produce your own env to test.

— Reply to this email directly, view it on GitHub https://github.com/vintasoftware/django-react-boilerplate/pull/667#issuecomment-2197510449, or unsubscribe https://github.com/notifications/unsubscribe-auth/AIZPCI26NOZO6WDUB2Y5WL3ZJW24PAVCNFSM6AAAAABKBKOYZGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCOJXGUYTANBUHE . You are receiving this because you authored the thread.Message ID: @.***>

hugobessa commented 2 months ago

This change is probably breaking CI and render.com setup as it introduces new required env vars that aren't mentioned there.

vaishnavi-2901 commented 2 months ago

Yes, mentioned the same on Note under description. Should I ping env file as well?

On Sat, 29 Jun 2024 at 01:07, Hugo Bessa @.***> wrote:

This change is probably breaking CI and render.com setup as it introduces new required env vars that aren't mentioned there.

— Reply to this email directly, view it on GitHub https://github.com/vintasoftware/django-react-boilerplate/pull/667#issuecomment-2197517539, or unsubscribe https://github.com/notifications/unsubscribe-auth/AIZPCI4GNAWJ3CJMCHMLDFTZJW3OPAVCNFSM6AAAAABKBKOYZGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCOJXGUYTONJTHE . You are receiving this because you authored the thread.Message ID: @.***>

fjsj commented 2 months ago

@vishu1089 you'll have to update render.yaml to not use SENDGRID_USERNAME and SENDGRID_PASSWORD and start using SENDGRID_API_KEY.

CTRL+F everywhere in the project for sendgrid and update whatever is necessary too, please.

vaishnavi-2901 commented 2 months ago

Will do, thanks for the heads up.

On Sat, 29 Jun 2024 at 01:12, Flávio Juvenal @.***> wrote:

@vishu1089 https://github.com/vishu1089 you'll have to update render.yaml to not use SENDGRID_USERNAME and SENDGRID_PASSWORD and start using SENDGRID_API_KEY.

CTRL+F everywhere in the project for sendgrid and update whatever is necessary too, please.

— Reply to this email directly, view it on GitHub https://github.com/vintasoftware/django-react-boilerplate/pull/667#issuecomment-2197526008, or unsubscribe https://github.com/notifications/unsubscribe-auth/AIZPCI3UDQIFNSOVP4MBMATZJW4EFAVCNFSM6AAAAABKBKOYZGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCOJXGUZDMMBQHA . You are receiving this because you were mentioned.Message ID: @.***>

vaishnavi-2901 commented 2 months ago

done, please recheck

vaishnavi-2901 commented 2 months ago

all the comments are resolved, please re-review

fjsj commented 2 months ago

Additionally, remove the poetry.lock file. We don't include that in the boilerplate, and it's risky to keep it anyway due to supply-chain attacks.

vaishnavi-2901 commented 2 months ago

Okay

fjsj commented 1 month ago

Closing due to inactivity. Please feel free to reopen with the issues addressed.